Skip to content

Instantly share code, notes, and snippets.

@ujihisa
ujihisa / vac230.md
Last active January 9, 2018 02:55
Vim Advent Calendar 2012 http://atnd.org/events/33746

Vim Advent Calendar 2012 ujihisa 15 (230日目)

Vim Advent Calendar 2012 の230日目の記事です。昨日の記事は@manga_osyoさんで、明日の記事はvital.vimコミッタの@rbtnnさんです。

今回は意表をついてVim scriptの入門記事です。

Vim script入門!

Vim script初級者レベルを10段階に分割すると、そのうち簡単な方から3つは、以下のようになります。

@ympbyc
ympbyc / FunctionalJs.md
Last active April 26, 2023 12:26
Functional JavaScript

Functional JavaScript

2013 Minori Yamashita ympby@gmail.com

-- ここにあなたの名前を追記 --

目次

@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@ahomu
ahomu / totsuzen.js
Created January 30, 2013 11:12
% totsuzen 突然の死 | pbcopy
#!/bin/node
// via http://starwing.net/suddenly_death.html
String.prototype.lengthByte = function()
{
var str = this;
var r = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
@ronkorving
ronkorving / ios6-timers.js
Last active March 9, 2022 03:40
iOS6 webkit timer bug workaround
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is released in the public domain. Do with it what you want, without limitations. I do not promise
// that it works, or that I will provide support (don't sue me).
// Author: rkorving@wizcorp.jp
var timeouts = {};
@averyvery
averyvery / seeds.rb
Created April 11, 2012 19:27
Seeding images in Rails
# encoding: utf-8
environment_seed_file = File.join(Rails.root, 'db', 'seeds', "#{Rails.env}.rb")
def seed_image(file_name)
File.open(File.join(Rails.root, "/app/assets/images/seed/#{file_name}.jpg"))
end
products = [
{:name => 'foo', :description => 'lorem ipsum', :product_type => ProductType.find_by_name('Sandwiches')},