Skip to content

Instantly share code, notes, and snippets.

View acro5piano's full-sized avatar
🏠
Working from home

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active April 9, 2025 09:08
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@gravitano
gravitano / Envoy.blade.php
Last active December 24, 2016 06:25
Envoy as Deployer
@servers(['web' => 'deploy-ex'])
@setup
$repo = '[email protected]:Servers-for-Hackers/deploy-ex.git';
$release_dir = '/var/www/releases';
$app_dir = '/var/www/app';
$release = 'release_' . date('YmdHis');
@endsetup
@macro('deploy', ['on' => 'web'])
@mahemoff
mahemoff / gist:45924a3d8c03d78f763b
Created March 15, 2015 16:40
Rails safe const get
# Get a constant by string/symbol, e.g. User.const :NAME_LIMIT
# Returns nil if no match
class Object
def self.const(s)
self.const_get(s) if self.const_defined?(s)
end
end
@trickart
trickart / fcitx-mozc-ut_PKGBUILD_20150222.diff
Last active November 22, 2016 06:57
AURのfcitx-mozc-utがビルドできないので書いた。2015/2/22版。来月には使えなくなってるはず
--- PKGBUILD.org 2014-11-18 18:06:33.000000000 +0900
+++ PKGBUILD 2015-02-22 16:18:42.861243876 +0900
@@ -52,12 +52,12 @@
## Mozc compile option
_bldtype=Release
-_mozcver=1.15.1917.102
-_utdicver=20141110
-_zipcoderel=201410
+_mozcver=2.16.2037.102
@benvium
benvium / apk-change-version-number.md
Created February 20, 2015 16:14
How to change the version number on an existing APK without re-building

This requires the latest version of apktool.

apktool d $APK_PATH -o $OUTPUT_FOLDER

# Open the apktool.yml text file
# Alter the versionCode and versionName entries

# now rebuild!
apktool build $OUTPUT_FOLDER 
@mingfang
mingfang / convert id_rsa to pem
Last active December 12, 2024 12:13
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@rauschma
rauschma / proxies-es5.js
Last active November 2, 2020 23:16
ES6 proxies in ES5
//----- The ECMAScript 6 meta object protocol (MOP) implemented in ES5
// This is how getting a property is handled internally.
// Double underscore (__) implies internal operation.
Object.prototype.__Get__ = function (propKey, receiver) {
receiver = receiver || this;
var desc = this.__GetOwnProperty__(propKey);
if (desc === undefined) {
var parent = this.__GetPrototypeOf__();
if (parent === null) return undefined;
@dodie
dodie / gist:f2c558c13ad29e165bf2
Created January 6, 2015 10:04
Xvfb take screenshot
Where 0 is the Xvfb screen number:
DISPLAY=:0 import -window root screenshot.png
@bradwestfall
bradwestfall / gist:f5a010e96fb0c4d18556
Last active November 20, 2022 14:40
Pull Instagram Images via JavaScript