Skip to content

Instantly share code, notes, and snippets.

View geta6's full-sized avatar

geta6 geta6

View GitHub Profile
@geta6
geta6 / ex13.coffee
Last active December 29, 2015 23:59
#!/usr/bin/env coffee
fs = require 'fs'
http = require 'http'
{exec} = require 'child_process'
http.get 'http://www.keio.ac.jp/ja/contact/sfc.html', (res) ->
data = ''
res.on 'data', (chunk) ->
data += chunk
@geta6
geta6 / Gruntfile.coffee
Created December 3, 2013 08:39
おれのかんがえたさいきょうのGruntfile
###
Gruntfile by geta6
usage:
grunt only build
grunt server + watch
install:
npm i --save-dev \
grunt \
/*
A list of possible usernames to reserve to avoid
vanity URL collision with resource paths
It is a merged list of the recommendations from this Quora discussion:
http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
Country TLDs found here:
http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
#!/bin/sh
gem uninstall -axI `gem list --no-versions | grep -v test-unit | grep -v rdoc | grep -v psych | grep -v io-console | grep -v rake | grep -v json | grep -v bigdecimal | grep -v minitest
'use strict'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-simple-mocha'
grunt.loadNpmTasks 'grunt-notify'
@geta6
geta6 / fizzbuzz.pl
Last active December 30, 2015 18:29
for (my $i = 1; $i <= 100; $i++) {
my $fb = 0;
if ($i % 3 == 0) {
$fb = 1;
print "fizz";
}
if ($i % 4 == 0) {
$fb = 1;
print "buzz";
}

ますいけん

2013.12.09

booth.pm

booth.pm

弊社、ECをはじめる

{jspack} = require 'jspack'
module.exports = class Asearch
INITPAT = 0x80000000
MAXCHAR = 0x100
isupper: (c) ->
return (c >= 0x41) and (c <= 0x5a)
@geta6
geta6 / endnanonna.sh
Created December 10, 2013 22:20
並列化4
#!/bin/zsh
START=$SECONDS
function terminate () {
echo 'Usage: endnanonna [target string] [output]'
exit 1
}
[[ -z $1 ]] && echo 'target string blank.' && terminate
@geta6
geta6 / progress.sh
Last active December 31, 2015 11:59
MAX=`echo "\`tput cols\` - 20" | bc`
PROGRESS() {
PRG=`echo "$1 * 100 / $2" | bc`
CUR=`echo "$MAX * $PRG / 100" | bc -l | cut -d'.' -f1`
STR='['
for i in `seq 1 $MAX`; do
if [[ $i -le $CUR ]]; then STR="$STR="; else STR="$STR "; fi
done
echo "$STR] $PRG%\r\c" >&2