Skip to content

Instantly share code, notes, and snippets.

View soharu's full-sized avatar

오자현 / Jahyun Oh soharu

View GitHub Profile
#!/user/bin/env python
import json
import sys
from types import *
def cpp_type(value):
if type(value) is IntType:
return 'int'
elif type(value) is FloatType:
@soharu
soharu / config.js
Created August 21, 2018 07:05 — forked from alldne/config.js
Resizing icon (iOS)
// npm install -g mobile-icon-resizer
// https://github.com/muzzley/mobile-icon-resizer
// mobile-icon-resizer -i icon1024.png --platforms ios --config config.js --iosof ios
function make(width, scale) {
var name = width + "";
var filename;
if (scale === 1) {
filename = "-" + name + ".png";
@soharu
soharu / OSX-Convert-MOV-GIF.md
Created February 26, 2018 10:28 — forked from tskaggs/OSX-Convert-MOV-GIF.md
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

@soharu
soharu / ipsc-submit.py
Last active July 11, 2017 12:09
IPSC submit script
#!/usr/bin/env python
# required requests and beautifulsoup4
# pip install requests
# pip install beautifulsoup4
import os
import sys
import re
import pickle
@soharu
soharu / process_py_image_filter.pyde
Last active April 18, 2017 12:26
Red filter in Processing.py
WIDTH = 360
HEIGHT = 240
def setup():
global img
img = None
noLoop()
size(WIDTH, HEIGHT)
frame.setResizable(True)
background(200)
@soharu
soharu / .bash_profile
Last active February 22, 2017 06:25
Bash setting for git
# Autocomplete Git Commands and Branch Names in Bash
#
# Download .git-completion.bash script
# curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
#
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# Git branch in prompt.
@soharu
soharu / gist:8285507
Created January 6, 2014 16:38
classof() function
function classof(o) {
if (o === null) return "Null";
if (o === undefined) return "Undefined";
return Object.prototype.toString.call(o).slice(8, -1);
}
@soharu
soharu / gist:8285069
Created January 6, 2014 16:11
Example of constructor property 3
function Range(from, to) {
this.from = from;
this.to = to;
}
Range.prototype = {
constructor: Range,
includes: function (x) {
return this.from <= x && x <= this.to;
},
@soharu
soharu / gist:8285049
Created January 6, 2014 16:09
Example of constructor property 2
function Range(from, to) {
this.from = from;
this.to = to;
}
Range.prototype.includes = function (x) {
return this.from <= x && x <= this.to;
};
Range.prototype.foreach = function (f) {