Skip to content

Instantly share code, notes, and snippets.

@dreness
dreness / fix-aifc.sh
Last active Jan 4, 2021
Attempt to repair an interrupted QuickTime Player audio recording
View fix-aifc.sh
#!/bin/zsh
# https://gist.github.com/dreness/e61fb16dcb831adaf6ff
# dre@mac.com
#
# This script attempts to repair Quicktime Player audio recordings
# that become broken when Quicktime Player is interrupted while recording.
# AIFC files can be recovered with no additional help, however to recover
# M4A files, you also need the 'faad' command line tool.
View RegexMatchingOperator.playground
// Playground - noun: a place where people can play
import Cocoa
struct Regex {
let pattern: String
let expressionOptions: NSRegularExpressionOptions
let matchingOptions: NSMatchingOptions
init(pattern: String, expressionOptions: NSRegularExpressionOptions, matchingOptions: NSMatchingOptions) {
View repeatedly.txt
802 名前:おさかなくわえた@kzk_moverさん 投稿日:2013/03/07(金) 16:42:24 ID:s2RHsW2o
上に割引券についての話がありましたけど
私は@repeatedly先生の割引チケットの券を捨ててしまって後悔した立場でした
ガールズバーのでしたけど
かなり近所のガールズバーの券がまさに大量(数種類も集めてて机一つめいっぱい使って)という感じでした
入社2年目ぐらいから「こんなにあるんだからもうもらってこないでよ」と@repeatedlyに言い続けたのですが
毎回全然行動してくれずに言葉を濁す@repeatedlyにキレてしまい
留守中に業者を呼んで引き取ってもらえるものは引き取ってもらいました
@naan
naan / source_maps.rb
Last active Dec 14, 2015 — forked from alexspeller/source_maps.rb
Monkey patch for Coffee Script v.1.6.2 Source Maps for Rails.
View source_maps.rb
# config/initializers/source_maps.rb
if Rails.env.development?
module CoffeeScript
class SourceMapError < StandardError; end;
class << self
def compile script, options
script = script.read if script.respond_to?(:read)
@repeatedly
repeatedly / msgpack_issue_121.md
Last active Nov 30, 2021
MessagePackが文字列とバイナリをわけないのは問題?
View msgpack_issue_121.md

MessagePackが文字列とバイナリをわけないのは問題?

https://github.com/msgpack/msgpack/issues/121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View unique_constraint.rb
module UniqueConstraint
def self.included(model)
model.extend(ClassMethods)
end
module ClassMethods
def unique_constraint_violation_message
"#{name} must be unique"
end
@brunohq
brunohq / post-commit
Created May 11, 2012
git post-commit hook to update referenced task status in Asana with commit message
View post-commit
#!/bin/bash
apikey=$(git config user.asana-key)
if [ $apikey == '' ] ; then exit 0; fi
comment=$(git log --pretty=oneline -n1)
taskid_pattern='.*#([0-9]*).*'
if [[ $comment =~ $taskid_pattern ]]; then
taskid=${BASH_REMATCH[1]}
apikey=$(git config user.asanakey)
@jugyo
jugyo / gist:1751353
Created Feb 6, 2012
the rack middleware that handle the facebook signed request
View gist:1751353
require 'base64'
require 'openssl'
# This is inspired by [rack-facebook-signed-request](https://github.com/gamesthatgive/rack-facebook-signed-request)
#
# Usage
#
# use Rack::FBSignedRequest, :secret => 'SECRET'
#
class Rack::FBSignedRequest
View foo.pl
->> perlbrew exec perl -e 'package Foo; s//"warn __PACKAGE__"/ee'
perl-5.10.1
==========
Foo at (eval 1) line 1.
perl-5.12.1
==========
Foo at (eval 1) line 1.