Skip to content

Instantly share code, notes, and snippets.

@gigorok
gigorok / rails.logrotate
Created March 19, 2018 18:01 — forked from constantinoneto/rails.logrotate
Logrotate for Rails
#
# File: /etc/logrotate.d/rails
# Test: logrotate -f /etc/logrotate.d/rails
#
/var/www/*/log/*.log {
daily
dateext
notifempty
missingok
rotate 30
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@genedelisa
genedelisa / MidIPlayer
Last active April 4, 2020 20:43
Swift AVMIDIPlayer
/// soundbanks are either dls or sf2. see http://www.sf2midi.com/
var soundbank:NSURL!
var mp:AVMIDIPlayer!
func playMIDIFile() {
// Load a SoundFont or DLS file.
self.soundbank = NSBundle.mainBundle().URLForResource("GeneralUser GS MuseScore v1.442", withExtension: "sf2")
// a standard MIDI file.
@sawapi
sawapi / AppDelegate.swift
Last active October 25, 2023 09:26
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
@moosan63
moosan63 / my brewfile
Last active August 29, 2015 13:56
My Brewfile
update
upgrade
#brew-cask
tap phinze/homebrew-cask || true
install brew-cask
###設定
#tools
@dlip
dlip / Capfile
Last active March 10, 2016 22:51
Capistrano 3 deploy notification email with git diff
require 'mail'
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@pcolazurdo
pcolazurdo / sunspot-solr.monit
Last active August 4, 2017 05:57
Sample sunspot-solr.monit file
check process sunspot-solr
with pidfile "/var/www/ot/shared/pids/sunspot-solr.pid"
group sunspot-solr
start program = "/bin/su - deploy -c 'cd /var/www/ot/current && bundle exec sunspot-solr start --port=9072 --bind-address=localhost --data-directory=/var/www/ot/shared/sunspot/data --solr-home=/var/www/ot/shared/sunspot --pid-dir=/var/www/ot/shared/pids --log-level=WARNING --log-file=/var/www/ot/shared/log/sunspot.log'"
stop program = "/bin/su - deploy -c 'cd /var/www/ot/current && bundle exec sunspot-solr stop --port=9072 --bind-address=localhost --data-directory=/var/www/ot/shared/sunspot/data --solr-home=/var/www/ot/shared/sunspot --pid-dir=/var/www/ot/shared/pids --log-level=WARNING --log-file=/var/www/ot/shared/log/sunspot.log'"
@pi8027
pi8027 / nakatoji.zsh
Last active October 8, 2015 03:38
中綴じ用の面付けをするスクリプト
#!/bin/zsh
[ -z $1 ] && exit -1
nakatoji_sequence(){
last=$((4 * $1))
for i in {1..$1} ; do
echo -n "$(($last - $i * 2 + 2)),$(($i * 2 - 1)),"
echo -n "$(($i * 2)),$((1 + $last - $i * 2)),"
done | sed "s/,$//g"
}
file=$(echo $1 | sed "s/\.pdf$//g")
@orzccc
orzccc / devise.ja.yml
Created July 13, 2012 10:04 — forked from yhara/devise.ja.yml
Japanese locale file for "Devise" (2.1.2) http://github.com/plataformatec/devise/wiki/I18n
ja:
errors:
messages:
expired: "の期限が切れましたので、新しくリクエストしてください"
# expired: "has expired, please request a new one"
not_found: "は見つかりませんでした"
# not_found: "not found"
already_confirmed: "は既に登録済みですのでログインしてください"
# already_confirmed: "was already confirmed, please try signing in"
not_locked: "は凍結されていません"