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 <stdlib.h> | |
#include <assert.h> | |
#include <string.h> | |
#include "c_vector.h" | |
// Return the vector size | |
size_t vector_size(vector *v) | |
{ | |
return v->size; | |
} |
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 | |
# Runs `./configure && make && make install' with variables set to help build libraries for iOS devices more easily. | |
# Hopefully, this will work as-is, but some notes... | |
# TODO: At least attempt to find correct directories without just failing with weird error messages | |
# > $DEVROOT _will_ have to change according to Xcode installation directory. | |
# > $CC or $CXX will probably change whenever a new compiler version is installed | |
# > $IOS_BASE_SDK or $IOS_DEPLOY_TGT may be changed to fit developer's needs as well as future Xcode layout changes (e.g. dropping support for older iOS versions) | |
# > Currently, a library for the simulator isn't being made (but should be _really_ easy to add with the existing script) | |
IOS_BASE_SDK="5.0" |
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 -e | |
make_a_pkg() { | |
printf '** Making package "%s"...\n' "$1" | |
tar zxf "$1.tar.gz" | |
cd "$1" | |
makepkg -si | |
cd .. | |
} |
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 argparse, os, re | |
beVerbose = False | |
def rename_files(replaceStr, withStr, files): | |
for file in args.files: | |
newName = re.subn(replaceStr, withStr, file) | |
if newName[1] != 0: | |
if beVerbose: print(file + ' => ' + newName[0]) |
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 | |
for f in *; do | |
if [ -d "$f/.git" ]; then | |
pushd "$f" && git pull --quiet && popd | |
fi | |
done |
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 | |
# This is boring... the least we can do is have nice colors! | |
white='\e[1;37m' | |
black='\e[0;30m' | |
blue='\e[0;34m' | |
light_blue='\e[1;34m' | |
green='\e[0;32m' | |
light_green='\e[1;32m' | |
cyan='\e[0;36m' |
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 ruby | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str | |
end | |
output='' |
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 | |
# If today is between two dates (following the YYYY-MM-DD format), then return "success" (e.g. 0). | |
# Else, return error (1). | |
time_between() { | |
begin_date=$1 | |
end_date=$2 | |
today=`date '+%Y-%m-%d'` | |
# Bash (usually) has no '>=' or '<=' when it comes to string comparison, so |
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 strict'; | |
function GeoLoc (lat, lon) { | |
this.lat = lat; | |
this.lon = lon; | |
} | |
function toRad(dec) { | |
return Math.PI * dec / 180; | |
} |
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 npm = require('npm'); | |
function npm_ready (err) { | |
if (err) { | |
console.log(err); | |
} | |
console.log('Searching...'); | |
npm.commands.search(['wa-source-'], false, function (err, data) { | |
console.log('Search done.'); |
OlderNewer