Skip to content

Instantly share code, notes, and snippets.

cu39 / .gitignore
Last active Jan 13, 2017
View .gitignore
cu39 /
Last active Nov 3, 2015
Create a git repo whose last commit has four parents
GIT=$(which git)
if [[ -d $TARGET_DIR ]]; then
echo $TARGET_DIR already exists.
exit 1
View gem_install.log
% gem install jekyll -V
302 Moved Temporarily
200 OK
302 Moved Temporarily
504 Gateway Time-out
ERROR: Could not find a valid gem 'jekyll' (>= 0), here is why:
cu39 /
Last active Aug 29, 2015
シンプルなWebサーバ+LivereloadだけのGruntfile ref:
"use strict"
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->
cu39 / dom_walkaround.jsx
Last active Dec 12, 2016
【InDesign】DocumentからスタートしてDocumentまで戻る【DOM散歩】 ref:
View dom_walkaround.jsx
var doc = app.activeDocument;$.writeln( doc ===
app.activeDocument // Document
.stories // Stories
.item(0) // Story
.paragraphs // Paragraphs
.item(0) // Paragraph
.parentTextFrames[0] // TextFrame (item() does not exist)
.parent // Page
.parent // Spread
.parent // Document
cu39 / 0_reuse_code.js
Created Mar 20, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:9445495
% brew list | while read formula; do; brew unlink $formula && brew link $formula; done
Unlinking /usr/local/Cellar/a52dec/0.7.4... 0 links removed
Linking /usr/local/Cellar/a52dec/0.7.4... 9 symlinks created
Unlinking /usr/local/Cellar/ack/2.12... 0 links removed
Linking /usr/local/Cellar/ack/2.12... 2 symlinks created
Unlinking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... 0 links removed
Linking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... 21 symlinks created
Unlinking /usr/local/Cellar/atk/2.10.0... 101 links removed
Linking /usr/local/Cellar/atk/2.10.0... 102 symlinks created
Unlinking /usr/local/Cellar/autoconf/2.69... 4 links removed
cu39 / config.js
Created Feb 9, 2014
Enable TeX and AsciiMath syntaxes with MathJax.
View config.js
config: [ "MMLorHTML.js" ],
jax: [ "input/AsciiMath", "input/TeX", "output/HTML-CSS", "output/NativeMML" ],
extensions: [ "asciimath2jax.js", "tex2jax.js", "mml2jax.js", "MathMenu.js", "MathZoom.js" ],
TeX: {
extensions: [ "AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js" ]
cu39 / common.thor
Last active Aug 29, 2015
Thor executable and tasks in separate file(s).
View common.thor
# coding: utf-8
class Top < Thor
include Thor::Actions
class << self
def baz
puts 'baz'
cu39 / pwgen
Last active Jan 2, 2016
Random string generator on shell
View pwgen
#!/usr/bin/env bash
# ref
usage() {
cat << EOF
Usage: ${0##*/} [-l letter_set] [-w word_num] [-n number_of_passwords]
Generates random letters for password.
You can’t perform that action at this time.