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 | |
# pass in the file name of the source as first parameter | |
mkdir -p generated | |
rm generated/* | |
# remove alpha with a simple trick | |
sips -s format bmp "$1" --out tmp.bmp | |
sips -s format png tmp.bmp --out "$1" |
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/ash | |
ssh git@ip 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
<?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
<!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
#!/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
var r = new marked.Renderer() | |
var oldCode = r.code; | |
r.code = function(code, lang) { | |
if (lang === "gist") { | |
return '<code gist="https://gist.github.com/' + code + '.json"></code>'; | |
} else { | |
return oldCode(code, lang); | |
} | |
} |
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 | |
define(DEBUG, 0); | |
$supported_languages = array("en", "de"); | |
$default_language = "en"; | |
$language = $default_language; | |
if (isset($_POST['lang']) && in_array($_POST['lang'], $supported_languages)) { // Detecting if param was set | |
$language = $_POST['lang']; | |
setcookie("language", $language, time()+ (3600 * 24 * 30)); // cache 30 days | |
if (DEBUG) echo "found parameter lang " .$language; |
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/sh | |
RESULT=$(xcodebuild -configuration Debug RUN_CLANG_STATIC_ANALYZER=YES) | |
if `echo ${RESULT} | grep "generated." 1>/dev/null 2>&1` | |
then | |
echo "commit failed: anaylzer error found" | |
exit 1 | |
fi |
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
NSMutableArray* topLevelObjs = [NSMutableArray array]; | |
NSDictionary* nameTable = [NSDictionary dictionaryWithObjectsAndKeys:self, NSNibOwner, topLevelObjs, NSNibTopLevelObjects, nil]; | |
if (![[NSBundle mainBundle] loadNibFile:@"bla" externalNameTable:nameTable withZone:nil]) { | |
NSLog(@"trouble loading bla.xib"); | |
return; | |
} | |
for (id object in topLevelObjs) { | |
if ([object isKindOfClass:[NSWindow class]]) { | |
[object makeKeyAndOrderFront:nil]; | |
break; |