Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dreness
dreness / fix-aifc.sh
Last active May 7, 2022 18:52
Attempt to repair an interrupted QuickTime Player audio recording
#!/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.
// 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) {
802 名前:おさかなくわえた@kzk_moverさん 投稿日:2013/03/07(金) 16:42:24 ID:s2RHsW2o
上に割引券についての話がありましたけど
私は@repeatedly先生の割引チケットの券を捨ててしまって後悔した立場でした
ガールズバーのでしたけど
かなり近所のガールズバーの券がまさに大量(数種類も集めてて机一つめいっぱい使って)という感じでした
入社2年目ぐらいから「こんなにあるんだからもうもらってこないでよ」と@repeatedlyに言い続けたのですが
毎回全然行動してくれずに言葉を濁す@repeatedlyにキレてしまい
留守中に業者を呼んで引き取ってもらえるものは引き取ってもらいました
@naan
naan / source_maps.rb
Last active December 14, 2015 13:48 — forked from alexspeller/source_maps.rb
Monkey patch for Coffee Script v.1.6.2 Source Maps for Rails.
# 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 November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

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

msgpack/msgpack#121

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

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

そもそもMessagePackとは

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

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:

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 14:37
git post-commit hook to update referenced task status in Asana with commit message
#!/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 February 6, 2012 10:25
the rack middleware that handle the facebook signed request
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
@gfx
gfx / foo.pl
Created December 13, 2011 00:57
s///ee
->> 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.