-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #910 from wakatime/feature/language-detection
Try to guess the language by file content
- Loading branch information
Showing
6 changed files
with
92 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Greet user and request their name | ||
echo "The activity generator" | ||
read -p "What is your name? " name | ||
|
||
# Create an array of activities | ||
activity[0]="Football" | ||
activity[1]="Table Tennis" | ||
activity[2]="8 Ball Pool" | ||
activity[3]="PS5" | ||
activity[4]="Blackjack" | ||
|
||
array_length=${#activity[@]} # Store the length of the array | ||
index=$(($RANDOM % $array_length)) # Randomly select an index from 0 to array_length | ||
|
||
# Invite the user to join you participate in an activity | ||
echo "Hi" $name, "would you like to play" ${activity[$index]}"?" | ||
read -p "Answer: " answer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
|
||
use Path::Tiny; | ||
|
||
my $dir = path('foo','bar'); # foo/bar | ||
|
||
# Iterate over the content of foo/bar | ||
my $iter = $dir->iterator; | ||
while (my $file = $iter->()) { | ||
|
||
# See if it is a directory and skip | ||
next if $file->is_dir(); | ||
|
||
# Print out the file name and path | ||
print "$file\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/python3 | ||
|
||
if __name__ == "__main__": | ||
print("Hello, World!") |