Skip to content

Instantly share code, notes, and snippets.

View Komsomol's full-sized avatar
🎯
Focusing

Farhad Agzamov Komsomol

🎯
Focusing
View GitHub Profile
@Komsomol
Komsomol / s3.sh
Last active August 28, 2019 22:57 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
[{"faceAnnotations":[{"landmarks":[{"type":"LEFT_EYE","position":{"x":267.9632568359375,"y":267.1448974609375,"z":-0.0016142273088917136}},{"type":"RIGHT_EYE","position":{"x":328.3736267089844,"y":267.34320068359375,"z":43.396759033203125}},{"type":"LEFT_OF_LEFT_EYEBROW","position":{"x":246.9328155517578,"y":250.86810302734375,"z":-11.135098457336426}},{"type":"RIGHT_OF_LEFT_EYEBROW","position":{"x":296.7423400878906,"y":255.49539184570312,"z":-2.360119104385376}},{"type":"LEFT_OF_RIGHT_EYEBROW","position":{"x":327.44207763671875,"y":254.90284729003906,"z":19.28240966796875}},{"type":"RIGHT_OF_RIGHT_EYEBROW","position":{"x":352.1405944824219,"y":250.13198852539062,"z":63.3874397277832}},{"type":"MIDPOINT_BETWEEN_EYES","position":{"x":311.80865478515625,"y":268.9999694824219,"z":10.090723037719727}},{"type":"NOSE_TIP","position":{"x":317.74432373046875,"y":319.380859375,"z":0.42038241028785706}},{"type":"UPPER_LIP","position":{"x":305.08697509765625,"y":344.5230407714844,"z":19.892587661743164}},{"type":"LOWER
@Komsomol
Komsomol / console_log_ie.js
Created July 21, 2016 12:17
IE8/IE9 Console.log warning removal
// console overwrite for IE8
if (window.console === undefined) {
window.console = {};
console.log = function() {};
console.error = function() {};
}
@Komsomol
Komsomol / gist:69ddfe298d3e0595c501e58d90cc3d1a
Created April 15, 2016 14:13
Setup XCode FileMerge as MergeTool for Git
// Tell terminal where FileMerge lives.
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
// Configure git to use FileMerge
git config --global merge.tool opendiff
// Run mergetool
git mergetool
@Komsomol
Komsomol / TrimVideoToBase64.sh
Last active January 22, 2016 16:11
This bash script will take a video, trim it, create a image sequence and create JS file with Base64 versions of the images.
#!/bin/bash
# Use > 1 to consume two arguments per pass in the loop (e.g. each
# argument has a corresponding value to go with it).
# Use > 0 to consume one or more arguments per pass in the loop (e.g.
# some arguments don't have a corresponding value to go with it such
# as in the --default example).
# note: if this is set to > 0 the /etc/hosts part is not recognized ( may be a bug )
while [[ $# > 1 ]]
do
@Komsomol
Komsomol / getHTML.sh
Created July 16, 2015 14:27
Bash Script to pull initializr Bootstrap to current directory
#!/bin/bash
echo 'Pulling initializr'
curl -o initializr.zip "http://www.initializr.com/builder?boot-hero&jquerymin&h5bp-favicon&h5bp-appletouchicons&modernizrrespond&simplehtmltag&izr-emptyscript&boot-css&boot-scripts"
echo 'Unzipping initializr'
unzip initializr.zip
echo 'Removing initializr'
rm initializr.zip
echo 'Copy to current directory'
cp -a initializr/. ./
echo 'Remove initializr copy'
@Komsomol
Komsomol / Check Orientation of Device
Last active August 29, 2015 14:12
Check for Window Orientation of mobile devices. Landscape and Portrait.
window.addEventListener('orientationchange', checkPage);
function checkPage(){
switch(window.orientation){
case 90:
currentState = 'landscape';
break;
case 0:
currentState = 'portrait';
break;