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
### Keybase proof | |
I hereby claim: | |
* I am joshmock on github. | |
* I am joshmock (https://keybase.io/joshmock) on keybase. | |
* I have a public key whose fingerprint is 7DE2 6FB1 0244 C3B7 5796 6A96 A0D0 224E 2C14 6AE2 | |
To claim this, I am signing this object: |
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
# A terrible attempt at listing function names that appear to not be used. Lots | |
# of false positives, especially for functions whose names are used as | |
# callbacks into other functions. | |
codepath=/path/to/javascript | |
tmpfile=/tmp/allfunctions | |
tmpfile2=/tmp/filteredfunctions | |
# search for function names | |
ack --type=js --output='$1' -h "(\w{3,})\:\s*function" $codepath > $tmpfile |
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
(defn calc-height-step [height current-step] | |
(if (= 1 (mod current-step 2)) | |
(* height 2) | |
(+ height 1))) | |
(defn calc-height [] | |
(def steps (Integer/parseInt (read-line))) | |
(println (reduce calc-height-step 1 (range 1 (+ steps 1))))) | |
(def t (Integer/parseInt (read-line))) |
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
#!/usr/bin/python | |
# put this in in a file in your Pi's /etc/init.d/ directory | |
import urllib2 | |
import subprocess | |
import smtplib | |
from email.mime.text import MIMEText | |
import datetime |
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
' Results: Looks at the names of all files in FOLDER_TO_SCAN, replacing any instance of STRING_TO_REPLACE with REPLACE_WITH in each filename. | |
Dim FOLDER_TO_SCAN, STRING_TO_REPLACE, REPLACE_WITH | |
FOLDER_TO_SCAN = "C:\Folder\to\scan\" | |
STRING_TO_REPLACE = "replace this" | |
REPLACE_WITH = "with this" | |
Dim fso, folder | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set folder = fso.GetFolder(FOLDER_TO_SCAN) |
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
' Results: Recurses through all subdirectories of FOLDER_TO_SCAN and finds all .FLV files that do not have an associated JPG splash image, then creates one 5 seconds into the video using FFMPEG command line tool. | |
' Assumes: FFMPEG (http://ffmpeg.org) command line tool is installed and its install directory is in the system Path variable. | |
Dim FOLDER_TO_SCAN | |
FOLDER_TO_SCAN = "C:\Folder\to\scan\" | |
Dim fso, rootFolder, convertedCount | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set rootFolder = fso.GetFolder(FOLDER_TO_SCAN) |
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
' Results: Prints a list of file names in FOLDER_TO_CHECK to the text file at OUTPUT_FILE_LOCATION | |
Dim FOLDER_TO_CHECK | |
FOLDER_TO_CHECK = "C:\Folder\to\list\" | |
OUTPUT_FILE_LOCATION = "C:\Temp\ListFileNames.txt" | |
Dim fs, logFile, folder | |
Set fs = CreateObject("Scripting.FileSystemObject") | |
Set logFile = fs.OpenTextFile(OUTPUT_FILE_LOCATION, 2) |
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
' Results: Scans READ_FILE and outputs all unique lines to WRITE_FILE. | |
' Assumes: Text file has been sorted alphabetically | |
' TODO: Universal search for line so file doesn't need to be sorted. | |
Dim READ_FILE, WRITE_FILE | |
READ_FILE = "C:\Input\textfile.txt" | |
WRITE_FILE = "C:\Output\textfile.txt" | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set inputFile = fso.OpenTextFile(READ_FILE, 1) '1 = for reading |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad | |
export PS1="\[$(tput setaf 1)\][\!] \[$(tput setaf 2)\]\w $ \[$(tput sgr0)\]" | |
alias crontab="VIM_CRONTAB=true crontab" |
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
PS1='\[\e[0;32m\][\t]\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]' |
OlderNewer