Skip to content

Instantly share code, notes, and snippets.

@geckotang
geckotang / bemtaro.md
Last active August 29, 2015 14:07
BEMだらけの桃太郎

BEMだらけの桃太郎

むかしむかし、あるところに、.parent-father + .parent-motherが住んでいました。
.parent-father--goes-mountain.parent-mother--does-washing
.parent-mother--is-doing-washingしていると、ドンブラコ、ドンブラコと、.peach--hugeが流れてきました。
「おや、これは.souvenir--niceになるわ」
.parent-mother.peach--hugeをひろいあげて、家に持ち帰りました。
そして、.parent-father + .parent-fatherが桃を食べようと.peach--has-cut、なんと中から.child-boy--is-energeticが飛び出してきました。
「これはきっと、#godがくださったにちがいない」
子どものいなかった.parent-father + .parent-motherは、大喜びです。

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
@tagawa
tagawa / sessionStorage.js
Created June 6, 2012 06:31
sessionStorage polyfill
/*
* Based on: http://www.quirksmode.org/js/cookies.html
* and https://github.com/wojodesign/local-storage-js/blob/master/storage.js
* and https://gist.github.com/350433
* License: http://www.opensource.org/licenses/MIT
*/
(function(window) {
'use strict';
window.sessionStorage = window.sessionStorage || {
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created June 3, 2012 19:30
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@inao
inao / markdown2inao.pl
Last active October 2, 2015 19:19 — forked from suzuki/markdown2inao.pl
GitHubに移行しました。 https://github.com/naoya/md2inao.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
use Encode;
@hokaccha
hokaccha / Cakefile
Created February 28, 2012 12:47
Cakefile
#
# modules
#
fs = require 'fs'
{exec} = require 'child_process'
#
# options
#
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@edom18
edom18 / css3-property-duplicate
Created May 15, 2011 01:23
CSSのプロパティを、ベンダープレフィクス付きで複製するスクリプト。(インデントも引き継ぐよう修正)
function! CSS3PropertyDuplicate()
let reg_save = @@
silent normal Y
let css3 = @@
let ind = matchlist(css3, '\v(\s*)(.*)')
let webkit = ind[1] . "-webkit-" . ind[2]
let moz = ind[1] . "-moz-" . ind[2]
let ms = ind[1] . "-ms-" . ind[2]
let o = ind[1] . "-o-" . ind[2]