Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
printf("%d arguments.\n", argc);
for(i = 0; i < argc; i++) {
#include <stdio.h>
#include <getopt.h>
int main(int argc, char *argv[])
{
int enable_dog;
int enable_egg;
int enable_farm;
struct option cmd_long_options[] = {
/* **
Got this error on OS X 10.6 with "/": {{{
$ ./a.out /
Query on: (0x7fff5fbff980) [/]
Get realpath: (0x7fff5fbfd620) [/]
a.out(348) malloc: *** error for object 0x7fff5fbfd620: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap
}}}
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
import logging
_log = logging.getLogger(__name__)
import uuid
#!/usr/bin/python
import os
for root, dirs, files in os.walk("."):
print "---"
print "root=%r" % (root,)
print "dirs=%r" % (dirs,)
print "files=%r" % (files,)
package main
import "fmt"
func main() {
fmt.Printf("Hello World.\n")
}
/*
@yinyin
yinyin / active.sh
Last active August 29, 2015 13:58
Workaround the Xcode 5.1 compile option issue on building extension with system Python
# add the following to bin/active script in virtualenv sandbox
echo "ARCHFLAGS=${ARCHFLAGS}"
export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
#!/usr/bin/env python
import sys
import pstats
input_path = sys.argv[1]
output_path = sys.argv[2]
fp = open(output_path, "w")
s = pstats.Stats(input_path, stream=fp)
#!/bin/bash
MVN_HOME=/.../apache-maven-3.3.3
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
exec $MVN_HOME/bin/mvn "$@"