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
# /etc/bash/bashrc | |
# | |
# This file is sourced by all *interactive* bash shells on startup, | |
# including some apparently interactive shells such as scp and rcp | |
# that can't tolerate any output. So make sure this doesn't display | |
# anything or bad things will happen ! | |
# Test for an interactive shell. There is no need to set anything |
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
# http://beust.com/weblog/2011/10/30/a-new-coding-challenge/ | |
require 'set' | |
def cut(a, n) | |
if a < n+1 | |
return nil | |
elsif n <= 0 | |
return [[a]] | |
elsif a == n+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
<appender name="STDOUT2" class="ch.qos.logback.core.ConsoleAppender"> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>TRACE</level> | |
<OnMatch>NEUTRAL</OnMatch> | |
<OnMismatch>DENY</OnMismatch> | |
</filter> | |
<layout class="ch.qos.logback.classic.PatternLayout"> | |
<Pattern>STDOUT1 %logger{36} - %msg%n</Pattern> | |
</layout> | |
</appender> |
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 flip(bit) { | |
return bit ? 0 : 1; | |
} | |
// each call simulates clock tick | |
function jk() { | |
var q=0; | |
return function(j, k) { | |
if (j) { | |
if (k) |
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
# dumps files in the format "file: <name>\n<file contents>" | |
$ git ls-tree --name-only -r HEAD | awk '{ print "echo file: "$0"; cat "$0; }' | sh |
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
// invoking inst.getYear(void) | |
inst.getClass().getMethod("getYear", void.class).invoke(t1, void.class)); |
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
/* from libxdiff's xutils.c */ | |
long xdl_bogosqrt(long n) { | |
long i; | |
/* | |
* Classical integer square root approximation using shifts. | |
*/ | |
for (i = 1; n > 0; n >>= 2) | |
i <<= 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
""" | |
See also: | |
- http://code.activestate.com/recipes/52549/#c6 | |
- http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application | |
""" | |
class curry: | |
def __init__(self, fun): | |
import inspect | |
self.fun = fun |
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 <ctype.h> | |
#include <malloc.h> | |
#include <stdarg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* utilities - shamelessly lifted from Git */ | |
void vreportf(const char *prefix, const char *err, va_list params) | |
{ |
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
<copy todir="${temp_dir}/tinymce"> | |
<fileset dir="."> | |
<include name="**"/> | |
<exclude name="**/.*/**"/> | |
<exclude name="**/.*"/> | |
<exclude name="build-utils/**" /> | |
<!-- let the other FileSet take care of it --> | |
<exclude name="jscripts/tiny_mce/themes/advanced/js/*" /> | |
</fileset> |