2013.12.09
弊社、ECをはじめる
| #!/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 |
| ### | |
| 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' | |
| 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
弊社、ECをはじめる
| {jspack} = require 'jspack' | |
| module.exports = class Asearch | |
| INITPAT = 0x80000000 | |
| MAXCHAR = 0x100 | |
| isupper: (c) -> | |
| return (c >= 0x41) and (c <= 0x5a) |
| #!/bin/zsh | |
| START=$SECONDS | |
| function terminate () { | |
| echo 'Usage: endnanonna [target string] [output]' | |
| exit 1 | |
| } | |
| [[ -z $1 ]] && echo 'target string blank.' && terminate |
| 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 |