Skip to content

Instantly share code, notes, and snippets.

View noodles-v6's full-sized avatar

noodles noodles-v6

View GitHub Profile
@electrum
electrum / gist:1169220
Created August 24, 2011 20:59
install hadoop-snappy
cd hadoop-snappy
# Mac OS X
tar xzvf ~/Downloads/snappy-1.0.3.tar.gz
cd snappy-1.0.3
./configure --prefix=$(greadlink -m $PWD/../snappy) && make install
cd ..
# Linux
wget http://snappy.googlecode.com/files/snappy-1.0.3.tar.gz
#!/bin/sh
pwd=`pwd`
for i in dot.*
do
if [ -d "$i" ]
then
for j in `find $i -type file`
do
s=`echo $j | sed -e s/^dot//`
@waltflanagan
waltflanagan / installhubot.sh
Created December 14, 2011 03:05
Install mac hubot
#!/bin/bash -e
# don't blunder on if an error occurs
set -e
# get configured
echo "Welcome to the TSC Hubot install script!"
read -ep "What hubot git should we install? " HUBOT_REPO
HUBOT_REPO=${HUBOT_REPO:-"git://github.com/TechSmith/hubot.git"}
read -ep "Where should it be checked out? " HUBOT_NAME
@billagee
billagee / netcat_wrapper.pl
Last active October 2, 2015 11:08
Perl snippet showing how to use netcat (nc) to poll a port, waiting for it to open
# Perl snippet showing how to use netcat (nc) to poll a port,
# waiting for it to open
#
# NOTE: You could also increase the value passed to -w to 60
# to do this, but you wouldn't get an up-to-the minute status
# message printed each second...
my $host = '192.168.1.100';
my $port = '443';
my $MAX_ATTEMPTS = 60; # Number of times to repeat the port check
@podgorniy
podgorniy / decorate.js
Created March 31, 2012 15:29
Safe javascript decorator
/*
Example of use
document.write = decorate (document.write, function () {
console.log(this === document);// true;
}, function () {
console.log('DOM is updated');
});
document.write = decorate (document.write, null, function () {
console.log('After document.write');
@makamaka
makamaka / OXGame.pm
Created May 21, 2012 04:51
やったー Yaircで○×ゲームできたよー
package Yairc::Plugin::OXGame;
=pod
○×ゲーム
3×3のマスに○と×を交互に置いて
タテ・ヨコ・ナナメ3連続になった方の勝ち
タグは #ox
まずはTAGSにoxを追加しておきましょう。
@wattsm
wattsm / PredefinedRulesSchema.cs
Created May 22, 2012 08:27
Predefined Validation Rules
public class PredefinedRulesSchema : IMessageSchemaProvider {
public MessageSchema GetSchema() {
return MessageSchema.Named("validated-message")
.WithRootName("Validated")
.WithProperty(
MessageSchemaProperty.Named("BooleanProperty")
.IsBoolean(BooleanTypes.YN)
)
@masak
masak / snippet1.p6
Created August 11, 2012 13:25
Small and attractive Perl 6 snippets
my $birth-date-string = prompt "When were you born (yyyy-mm-dd)?";
my $birth-date = Date.new($birth-date-string);
my $today = Date.today;
my $age = $today.year - $birth-date.year;
# But your birthday this year may not have been yet
if $today.day-of-year < $birth-date.day-of-year {
$age--;
}
@costin
costin / MahoutTests-context.xml
Created September 24, 2012 14:08
Mahout SHDP Tool Config
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
@tony0x59
tony0x59 / GradientView.m
Last active December 17, 2015 18:19
iOS UIView 渐变色绘制
//
// GradientView.m
// GradientDemo
//
// Created by Tony Kong on 13-5-26.
// Copyright (c) 2013年 Tony Kong. All rights reserved.
//
#import "GradientView.h"