Skip to content

Instantly share code, notes, and snippets.

View simplesessions's full-sized avatar
💭
Busy, busy, busy!

Charles Kihe simplesessions

💭
Busy, busy, busy!
View GitHub Profile
@simplesessions
simplesessions / .bash_profile
Last active April 2, 2018 10:20
Bash Profile
# Some config taken from https://natelandau.com/my-mac-osx-bash_profile/
# ---------------------------------------------------------
# GENERAL: Exports
# ---------------------------------------------------------
export CLICOLOR=1 # add colors to the output
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # ^
@simplesessions
simplesessions / wordpress-ubuntu_1604-nginx_mainline.sh
Last active March 15, 2018 18:50
Install PHP7 FPM, nginx mainline, mariaDB, iptables, Wordpress, WP-CLI
#### BEFORE USING THIS, CHANGE ALL THE VALUES BETWEEN DOUBLE-SQUARE-BRACKETS ####
# SEE THE END OF THIS FOR REFERENCES
# YOU SHOULD BE ABLE TO COPY AND PASTE THE FOLLOWING LINES,
# BUT CHUNK IT OUT BY THE # ===== separators
# PERFORM AS ROOT UNLESS OTHERWISE SPECIFIED
# ===== BEGIN INITIAL SETUP
@simplesessions
simplesessions / delete.txt
Created March 9, 2016 22:05
Linux: Super fast delete
# based on http://www.stevekamerman.com/2008/03/deleting-tons-of-files-in-linux-argument-list-too-long/
ls -1 | wc -l && time find . -type f -delete
### XCode
echo "Installing XCode Tools"
xcode-select --install
### Homebrew
echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
### Git
brew install git
@simplesessions
simplesessions / gist:7f614be80fafe9cd3bf3
Created January 25, 2016 20:23
libv8 + therubyracer sucks
brew install homebrew/versions/v8-315
brew link --overwrite v8-315 --force
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-system-v8
@simplesessions
simplesessions / gist:6eb91786e21dc2a77917
Created December 30, 2015 22:12
ffmpeg web video settings
# per http://asisolve.com/ffmpeg-encoding-settings-for-web-video/
ffmpeg -i [path-to-video] -vcodec libx264 -preset slow -profile main -crf 25 -acodec libfdk_aac -ab 64k [new-video-name].mp4
/* per http://stackoverflow.com/questions/20590239/maintain-aspect-ratio-of-div-but-fill-screen-width-and-height-in-css */
div {
width: 100vw;
height: 56.25vw; /* height:width ratio = 9/16 = .5625 */
background: pink;
max-height: 100vh;
max-width: 177.78vh; /* 16/9 = 1.778 */
margin: auto;
position: absolute;
top:0;bottom:0; /* vertical center */
@simplesessions
simplesessions / gist:b1d1608a3b5a0595092a
Created August 28, 2015 02:47
Converting video to uncompressed AVI
ffmpeg -i "$in_file" -vcodec rawvideo -pix_fmt uyvy422 -vtag 2vuy -acodec $audio-codec "$out_file"
mixin tabMenu
ul.menu.tabs(data-tab role="tablist")
if block
block
mixin tabMenuItem(id, label, active)
li(class="tab-title"+(active ? " active" : "") role="presentational")
a(href=("#"+id) role="tab" tabindex="0" aria-selected="true" controls=id)=label
mixin tabContentContainer
@simplesessions
simplesessions / gist:7033448
Last active December 25, 2015 20:18
Performant way of checking document size?
windowResizeHandler = null;
$(window).resize(function() {
clearTimeout(windowResizeHandler);
windowResizeHandler = setTimeout(function() {
var docWidth = $('document').width();
if (docWidth > 200) {
// do some'n
}
}, 250);