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/env python | |
import sys | |
c = sys.stdin.read(1) | |
while len(c) > 0: | |
sys.stdout.write("{0:02x}".format(ord(c))) | |
c = sys.stdin.read(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
#!/usr/bin/env python | |
def g1_from_point(point): | |
return "G1 X{} Y{} Z{}\n".format(round(point[0], 5), round(point[1], 5), round(point[2], 5)) | |
def g1_from_speed(speed): | |
return "G1 F{}\n".format(speed) | |
if __name__ == '__main__': |
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
#include <unistd.h> | |
#include <fcntl.h> | |
#include <termios.h> | |
#include <stdio.h> | |
#include <sys/select.h> | |
#include <signal.h> | |
#include <string.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <stdlib.h> |
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
# Usage: | |
# osascript sendimessage.applescript <recipient> <message> | |
on run {targetBuddyPhone, targetMessage} | |
tell application "Messages" | |
set targetService to 1st service whose service type = iMessage | |
set targetBuddy to buddy targetBuddyPhone of targetService | |
send targetMessage to targetBuddy | |
end tell | |
end run |
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
#ifdef STANDARD | |
/* STANDARD is defined, don't use any mysql functions */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#ifdef __WIN__ | |
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ | |
typedef __int64 longlong; | |
#else | |
typedef unsigned long long ulonglong; |
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 | |
FPS=14 | |
WIDTH=640 | |
PALETTE=/tmp/palette.png | |
INPUT="$1" | |
OUTPUT="$2" | |
KEEP_PALETTE="$3" |
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 | |
UUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID` | |
echo "UUID=$UUID" | |
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add "$UUID" |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <errno.h> | |
#include <getopt.h> | |
#define VERSION "1.1" | |
typedef enum { |
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 | |
USERNAME="" | |
IDENTITY="" | |
IP="" | |
STATE="" | |
usage() { echo "Usage: $0 [-u <ssh username> ] [-k <ssh identity file>] [-i <ip address>] [-s <on|off>]" 1>&2; exit 1; } | |
while getopts "u:k:i:s:" o; do |
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
#include <stdint.h> | |
#include <stdio.h> | |
int ones_count(uint32_t i) { | |
i = i - ((i >> 1) & 0x55555555); | |
i = (i & 0x33333333) + ((i >> 2) & 0x33333333); | |
return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; | |
} | |
int main (int argc, char *argv[]) { |