Skip to content

Instantly share code, notes, and snippets.

@roxlu
roxlu / AudioConverterBrain.cpp
Created May 6, 2016 20:05
Example implementation of using the amazing b8brain audio samplerate converter, https://github.com/avaneev/r8brain-free-src This was used for a real time audio stream converter.
#include <poly/AudioConverterBrain.h>
#include <poly/AudioDataConverter.h>
namespace poly {
AudioConverterBrain::AudioConverterBrain()
:listener(NULL)
{
}

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@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 に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
  • 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
@nakiwo
nakiwo / gist:3179598
Created July 26, 2012 00:46
Xcode4.4 iOS SDKで @yES,@no,array[...],dictionary[...]を使う
// Xcode4.4
// llvm4の機能のうち一部が、
// iOS 5.1 SDK で使えない
//
NSNumber *b = @YES; // error
NSArray *array = @[ @1, @2, @3 ];
NSNumber *n = array[1]; // error
@Gab-km
Gab-km / smugnessProblem.rst
Created April 19, 2012 08:01
コードウォッチ:関数型プログラミングの自惚れ問題

コードウォッチ:関数型プログラミングの自惚れ問題

原文

http://www.sdtimes.com/link/36534

著者

Larry O'Brien

僕は関数型プログラミングが好きだ。次の10年にかけてコードの革命を起こしていくだろうと考えている:言語はより関数型の機能を採用していくだろうし、開発者はより関数型の技術を導入していくだろうし、いくつかの点では、関数型プログラミングの原則はコードを組み立てていく上で「自然で」もっとも明確なやり方だとみんな考えるようになっていくだろう。

だけど、僕はもうこのシナリオを本気にしちゃいない。関数型プログラミングは、ワクワクするものを学ぶことに興味があると言っている主流のプログラマにとって明白な、大きな問題を抱えている:関数型プログラマーは自惚れ野郎どもだってことだ。

@geddski
geddski / nesting.js
Created January 14, 2012 05:08
helper function for nesting backbone collections.
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
@aki-null
aki-null / gist:1497649
Created December 19, 2011 15:23
Core Text APIを使用した際に起こる行間の問題の回避
NSFont *normalFont = [NSFont systemFontOfSize:12];
CGRect renderFrame = CGRectMake(0, 0, 300, 50); // box to render the text into
static NSLayoutManager *layMan = nil;
if (!layMan) {
layMan = [NSLayoutManager new];
}
CGFloat lineHeight = [layMan defaultLineHeightForFont:normalFont]; // calculate the expected height of a line
NSDictionary *attrDict = [NSDictionary dictionaryWithObject:normalFont andKey:NSFontAttributeName];
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@poutyface
poutyface / gist:1223553
Created September 17, 2011 02:25
QEMU: 仮想ボード ARM Cortex-A9 マルチコアで Linux を動かす
モチベーション
---------------
Androidのエミュレータは中でQEMUを使ってる
中で使われているので、Android開発とは直接関係がないけど、
素のQEMUの使い方を知る。
* QEMUの使い方を覚える
* Linuxをエミュレータ環境で動かしてみる
* ARM のクロス環境に慣れてみる
@darkseed
darkseed / Reachability.h
Created August 30, 2011 23:16 — forked from dhoerl/Reachability.h
Reachability (iOS) ARCified
/*
File: Reachability.h
Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
Version: 2.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software