This file contains hidden or 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
| <?php | |
| $randomIntegers = array_fill(1, 10, 0); | |
| for ($i = 0; $i < 1000; $i++) { | |
| $randomInt = rand(1, 10); | |
| $randomIntegers[$randomInt]++; | |
| } | |
| $j = 0; | |
| foreach ($randomIntegers as $number) { |
This file contains hidden or 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
| #!/bin/bash | |
| # Taken from http://triq.net/script/rotating-folder-backup-script | |
| # because the site is slow and down, and I wanted to review this later | |
| # Originally created by zany on Tue, 03/17/2009 - 13:38 | |
| BASEDIR=/home/projects # SET THIS | |
| BAKDIR=/home/backups # SET THIS | |
| stamp=$(date +%Y-%m-%d) | |
This file contains hidden or 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
| << | |
| testUnit = [ | |
| ["5303271788938868", "Mastercard"], | |
| ["5172130074420403", "Mastercard"], | |
| ["5528046926304929", "Mastercard"], | |
| ["5123524378572523", "Mastercard"], | |
| ["5570030393432659", "Mastercard"], | |
| ["5207435393545197", "Mastercard"], | |
| ["5251165104558727", "Mastercard"], |
This file contains hidden or 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
| -- Use tr.im as a url shortner for LaunchBar | |
| -- http://twitter.com/cometbus | |
| -- 01:17:55 PM [05/31/2009] | |
| -- Initial script | |
| -- 02:01:19 PM [05/31/2009] | |
| -- Added in truncateString() function | |
| -- Added in urlencodetext() function |
This file contains hidden or 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
| --Simple growl notification function. Will register as well as display a message with growl | |
| -- 03/19/2010 Scott Haneda <scott@newgeo.com> | |
| -- | |
| -- Sample Usage: growlMessage("Title of growl window", "Body message → of growl window", "Give a Name", "Name of App for icon") | |
| -- The last argument is for an icon, you can use the name of any installed application, with or without the .app extension | |
| using terms from application "AppleScript Utility" | |
| on growlMessage(growl_notification_title, growl_notification_body, growl_app_name, growl_icon) | |
| tell application "AppleScript Utility" | |
| -- growl_notification_title, The title in the actual growl window |
This file contains hidden or 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
| -- Copy and paste all the code below into your Script Editor and run it as you see fit | |
| -- PURPOSE: Export all notes in Evernote to an ENEX file so that | |
| -- the notes can be backed up to an external drive or to the cloud | |
| -- Change the path below to the location you want the notes to be exported | |
| set filename to (do shell script "date '+%Y-%m-%d-%H.%M.%S'") & (".export.enex") | |
| -- Get the path the Application Support and then append the backup folder | |
| set e to path to application support from user domain | |
| set p to POSIX path of e & "Evernote-Backups/" |
This file contains hidden or 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
| #!/bin/bash | |
| # 01/31/15 - 06:12:06 A.M. | |
| echo -e "\ndrops-size is shell script that scans Dropbox and finds files I have shared that | |
| are too large and need to be looked at for potential deletion\n\n" | |
| # Variables that are used often enough to need setting them, yup, cool comment | |
| # Directory where we are scanning files | |
| DEST=/Users/$USER/Dropbox/Public/drops | |
| SIZE="+250k" # The size as defined in the find man page, getting all files larger… | |
| TEMP="/tmp/drops-output.txt" |
This file contains hidden or 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
| #!/bin/bash | |
| /Applications/Arq.app/Contents/MacOS/Arq backupnow& | |
| echo 'Arq is backing up now.' | |
| # Toss the application backup trigger into the background. | |
| # Somehow, this will run via a keystroke triggering app without root access, which to backup your | |
| # entire comptuer, you are going to need root access to backup any system files | |
| # Perhaps I am remembering incorrectly and I was only backing up ~/ | |
| # Though even still, there are a few root owned ( Intentionally created and placed under certain strict chown:chmod) |
This file contains hidden or 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
| # running this will create the file in whatever directory your terminal is in. | |
| # A newly opened Terminal will create a file in your ~/home directory. If you already | |
| # have a Terminal open type 'cd' and press return, that will bring you to your home directory. | |
| dd if=/dev/random of=LargeFileForScott.img bs=1024 count=0 seek=$[1024*1000] | |
| # Or we can force it on your Desktop: | |
| dd if=/dev/random of=~/Desktop/LargeFileForScott.img bs=1024 count=0 seek=$[1024*1000] |
This file contains hidden or 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 script will make Time Machine perform an incremental backup as if you were | |
| to either let it run on schedule or select the menulet from the menu bar. | |
| ------------ Type `man tmutil` for all the options ------------ This should be | |
| run as root to work corrcty, which will make it much harder to run from a | |
| launcher or from a keyboard launcher, as they are not directy set up to accept | |
| user input. | |
| Below is the `readme.md` that I made to go with these files, though it is | |
| probebly no longer needed given this is so simple I am merely making a `gist` |
NewerOlder