Skip to content

Instantly share code, notes, and snippets.

View fishkingsin's full-sized avatar
🦾

James Kong fishkingsin

🦾
View GitHub Profile
@tado
tado / swift3d.swift
Created August 28, 2014 07:15
Generative 3D for Swift Playground
import SceneKit
import XCPlayground
let width:CGFloat = 400
let height:CGFloat = 400
var view = SCNView(frame: CGRect(
x: 0,
y: 0,
width: width,
@chenhan1218
chenhan1218 / WebRTC-on-LAN.md
Last active September 23, 2022 07:43
WebRTC on LAN

WebRTC on LAN

剛嘗試了怎麼樣在區域網路中使用 WebRTC 來進行 VOIP,意外發現其實滿簡單的。分享一下我的步驟

P.S 這是提供給外部網路不通的環境下,如果外部網路通暢,那麼可以直接用現有服務,如 https://talky.io/ 即可

架起 WebRTC Signal Server

git clone https://github.com/andyet/signalmaster
@MartinBspheroid
MartinBspheroid / gist:8902181
Last active November 16, 2022 05:39
openFrameworks hacks (win64)
// TESTED ON nightly-build ver 0.8 (of_v20130813) in Visual Studio 2012 - Win64
// MAKE APP ALWAYS ON TOP
HWND AppWindow = GetActiveWindow();
SetWindowPos(AppWindow, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOMOVE | SWP_NOSIZE);
// DISABLE FUNCTION DESCRIBED ABOVE
HWND AppWindow = GetActiveWindow();
@beve
beve / index.js
Last active December 30, 2015 05:39
Raspberry Pi + Nodejs + PIR module + webcam + Philips Hue
var hue = require("node-hue-api");
var HueApi = require("node-hue-api").HueApi;
var gpio = require("gpio");
var nodemailer = require("nodemailer");
/* ************* */
/* CONF */
/* ************* */
var usernameHue = ''; // md5sum
@jvcleave
jvcleave / distccd-rpi.plist
Last active April 30, 2024 06:27
mac distcc install instructions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>distccd-rpi</string>
<key>Program</key>
<string>/Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh</string>
<key>RunAtLoad</key>
<true/>
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active November 5, 2024 21:41
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@max-mapper
max-mapper / helloworld.js
Created November 27, 2012 06:55
droneduino
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})
@hrydgard
hrydgard / OpenSLWrap.cpp
Created July 8, 2012 19:48
A minimal implementation of audio streaming using OpenSL in the Android NDK
// Minimal audio streaming using OpenSL.
//
// Loosely based on the Android NDK sample code.
// Hardcoded to 44.1kHz stereo 16-bit audio, because as far as I'm concerned,
// that's the only format that makes any sense.
#include <assert.h>
#include <string.h>
// for native audio
@reidransom
reidransom / gist:2630650
Created May 7, 2012 21:41
Timecode burn with ffmpeg
# Timecode burn with ffmpeg
# ffmpeg must be configured with --enable-libfreetype
# box=1 - tells ffmpeg to draw a box around the text
# boxcolor - format is 0xRRGGBB[AA]
ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=23.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov