Skip to content

Instantly share code, notes, and snippets.

View maeharin's full-sized avatar

Hidenori Maehara maeharin

View GitHub Profile
@cyberdelia
cyberdelia / fabfile.py
Created April 3, 2010 14:05
Fabric deploy script with : south migrations, rollback and maintenance page.
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
@postmodern
postmodern / gist:900981
Created April 4, 2011 00:45
implicit splat and explicit splat in Ruby 1.9
class Command
def initialize(path,arguments,env={})
@path = path
@arguments = arguments
@env = env
end
def to_ary
[@env, @path, @arguments]
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@webmat
webmat / dashboards.rb
Created February 22, 2012 20:46
First draft of an active_admin-based view for Delayed::Job
ActiveAdmin::Dashboards.build do
# Add this section in your dashboard...
section "Background Jobs" do
now = Time.now.getgm
ul do
li do
jobs = Delayed::Job.where('failed_at is not null').count(:id)
link_to "#{jobs} failing jobs", admin_jobs_path(q: {failed_at_is_not_null: true}), style: 'color: red'
end
@takungsk
takungsk / 0-type_parameter.md
Created September 21, 2012 09:11
[Scala] 型パラメータによる 関数の一般化 例

[Scala] 型パラメータによる 関数の一般化 例

Monoid, 型パラメータ, implicitを使った加算する関数の一般化

半年ぐらい前ですが、Scalaz の解説のプレゼンテーションである、 Scalaz Presentationという プレゼン動画を見ました。
Nick Partridgeさんというオーストラリアの方が、約1年半前に Scalazの説明をされているプレゼンなのですが
半年前に見たときは 何をやっているのかさっぱり理解出来ませんでした。
今 もう一度みると Scalaz に限らず 型パラメータつかって関数を一般化するのに
段階をおって一般化されていくので すごくよくできたプレゼンの内容であるのがやっとわかるようになってきました。

すぐれた PHP ライブラリとリソース

Awesome PHP の記事をフォークして翻訳したものです (2013年4月25日)。おどろくほどすごい PHP ライブラリ、リソースやちょっとした情報のリストです。

【訳者コメント】 PHP 入門者のかたにはクィックリファレンスとして PHP: The Right Way 、セキュリティに関しては2011年3月に出版された 体系的に学ぶ 安全なWebアプリケーションの作り方 をおすすめします。

Composer

@shinyaohira
shinyaohira / App States and Multitasking.md
Last active October 5, 2023 07:57
アプリケーションの状態とマルチタスキング

全体的に簡略化し、必要と思われる部分を抜粋しました。

  • Not running

    アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。

  • Inactive

@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/