Skip to content

Instantly share code, notes, and snippets.

VAR_NAME :=
.PHONY: var
var:
@echo $($(filter $(VAR_NAME),$(.VARIABLES)))
@zoncoen
zoncoen / check_video_stream.sh
Last active April 22, 2016 08:21
ffmpegで動画の設定チェックする君
#!/bin/bash
declare -A Opts=([verbose]=0)
function main() {
declare -i argc=0
declare -a argv=()
: 'Parse args' && {
while (($# > 0))
@zoncoen
zoncoen / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zoncoen
zoncoen / demo.go
Created June 25, 2014 11:08
expvar package demo for Gunosy.go #3.
package main
import (
"expvar"
"io"
"net/http"
)
var numCalls = expvar.NewInt("num_calls")
@zoncoen
zoncoen / vertical_centering.js
Created June 18, 2014 00:47
Print pdf with vertical centering contents in Reveal.js. Run this snippet on the Chrome dev tools just before exporting the PDF. (https://github.com/hakimel/reveal.js/issues/563)
function toArray(o) {
return Array.prototype.slice.call(o);
}
toArray( document.querySelectorAll( '.reveal .slides section' ) ).forEach(function(slide){
var outerWrapper = document.createElement('div');
outerWrapper.style.cssText = 'display:flex; align-items:center; height:100%';
var wrapper = document.createElement('div');
wrapper.style.width = '100%';
@zoncoen
zoncoen / gulpfile.js
Created May 15, 2014 15:50
LiveReload with gulp.
var gulp = require('gulp'),
express = require('express'),
connect_livereload = require('connect-livereload'),
livereload = require('gulp-livereload');
var EXPRESS_PORT = 4000;
var EXPRESS_ROOT = __dirname;
function startExpress() {
var app = express();
@zoncoen
zoncoen / javascript.vim
Last active January 3, 2016 07:58
Overlay '寿' on 'function' in javascript file. Require Vim’s conceal feature.
" $HOME/.vim/after/syntax/javascript.vim
if !has('conceal')
finish
endif
set conceallevel=2
syntax clear javaScriptFunction
syntax keyword javaScriptFunction function nextgroup=javaScriptFuncName skipwhite conceal cchar=寿