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
#!/bin/bash | |
/usr/bin/ssh git@op6 expand > repos.txt | |
myarr=($(awk '{print $NF}' repos.txt)) | |
counter=0 | |
for i in "${myarr[@]}" | |
do | |
counter=$(($counter+1)) | |
if [ "$counter" -eq 1 ] || [ "$counter" -eq 2 ] | |
then |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>SBB Verspätungen</title> | |
<!-- Normalize.css is a customisable CSS file that makes browsers render all elements more consistently and in line with modern standards. --> | |
<link rel="stylesheet" media="screen" href="https://raw.github.com/necolas/normalize.css/master/normalize.css"> | |
<style> |
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
<?php | |
if (extension_loaded("facedetect")) { | |
echo "facedetect extension loaded \n"; | |
} else { | |
echo "facedetect extension not loaded, can't do face detect \n"; | |
} | |
$file = "haarcascade_frontalface_alt.xml"; |
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
package main | |
/* | |
#cgo CFLAGS: -x objective-c | |
#cgo LDFLAGS: -framework Cocoa | |
#import <Cocoa/Cocoa.h> | |
int | |
StartApp(void) { | |
[NSAutoreleasePool new]; |
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
#!/bin/bash | |
git clone -b master --single-branch . temp | |
cd temp | |
find . -type f -exec curl -u USER:PASSWORD --ftp-create-dirs -T {} ftp://server/path/to/www/{} \; | |
rm -rf temp |
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
set oldTrack to "" | |
set current_user to do shell script "whoami" | |
set the_file to "/Users/" & current_user & "/NowPlaying.txt" | |
do shell script "touch " & POSIX path of the_file -- create file | |
repeat | |
if application "Spotify" is not running then | |
say "spotify is not running" |
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
var startTime: NSDate | |
let defaults = NSUserDefaults.standardUserDefaults() | |
defaults.setObject(startTime, forKey: "startTime") | |
// ... | |
let defaults = NSUserDefaults.standardUserDefaults() | |
if let object: AnyObject = defaults.objectForKey("startTime") { | |
startTime = object as! NSDate |
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
/* | |
* Print interface statistics in bytes per second | |
* | |
* Parameters: | |
* -t # Time interval to compute, default 2 seconds | |
* -i <ifname> Interface name, defaults to 'en0' | |
* -s Print raw stats | |
* | |
* Output: Two numbers separated by a space. First value is input bytes per | |
* second. Second value is output bytes per second |
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
function run(input, parameters) { | |
dropboxURL = "https://dl.dropboxusercontent.com/u/XXXXXXX/FOLDER/"; | |
currentApp = Application.currentApplication() | |
currentApp.includeStandardAdditions = true | |
inFile = input.toString() | |
inFile = basename(inFile) | |
inFile = encodeURIComponent(inFile) | |
//currentApp.displayAlert(dropboxURL + inFile); | |
currentApp.setTheClipboardTo(dropboxURL + inFile) |
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
// use it in calender: http://apple.stackexchange.com/a/59265/14030 | |
app = Application.currentApplication() | |
app.includeStandardAdditions = true | |
ObjC.import('Cocoa') | |
dict = $.NSDictionary.dictionaryWithContentsOfFile('/Library/Preferences/com.apple.TimeMachine.plist') | |
firstItem = dict.valueForKey('Destinations').firstObject | |
lastBackup = firstItem.valueForKey('SnapshotDates').lastObject | |
diff = lastBackup.timeIntervalSinceNow // in seconds |
OlderNewer