Skip to content

Instantly share code, notes, and snippets.

View takeshy's full-sized avatar

takeshy takeshy

  • Sun Asterisk
  • Yokohama
View GitHub Profile
@tily
tily / dot.mongorc.js
Created October 7, 2011 13:40
MongoDB DBQuery extension for easier printjson
DBQuery.prototype.p = function() {
var args = arguments
this.forEach(function(e) {
var result = {}
if(args.length == 0) {
result = e
} else {
for(var i = 0; i < args.length; i++) {
var target = e
var keys = args[i].split('.')
@sinisterchipmunk
sinisterchipmunk / LICENSE
Last active September 8, 2023 17:57
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@jcsrb
jcsrb / article_image_uploader.rb
Created December 22, 2011 15:02
CarrierWave extension fix_exif_rotation, strip, quality, resize_to_fill_if_larger
class ArticleImageUploader < ImageUploader
process :fix_exif_rotation
process :strip
process :convert => 'jpg'
process :quality => 85 # Percentage from 0 - 100
version :gallery_thumb do
process :resize_to_fill => Settings.images.article_images.processing.gallery_thumb #44x44
end
@okapies
okapies / promises-are-functional.md
Last active August 14, 2023 11:44
翻訳: ”命令型のコールバック、関数型のプロミス: Node が逸した最大の機会” by James Coglan

命令型のコールバック、関数型のプロミス: Node が逸した最大の機会

Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan

Translated by Yuta Okamoto (@okapies)

Note

  • 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
  • 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。