Skip to content

Instantly share code, notes, and snippets.

View yetithefoot's full-sized avatar
:octocat:
Loading status...

Vlad Tsepelev yetithefoot

:octocat:
Loading status...
View GitHub Profile
@yetithefoot
yetithefoot / chrome-enable-memory
Last active December 27, 2020 14:28
Runs Google Chrome with memory objects
To enable window.gc() on Chrome browser console you just need to start Chrome like this:
> /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --js-flags="--expose-gc" --enable-memory-info
Those flags enable the following console API, very usefull to debug memory leaks:
> console.memory // print memory information
> window.gc() // force garbage collection
@yetithefoot
yetithefoot / zsh.md
Last active April 6, 2024 12:00 — forked from tsabat/zsh.md
@yetithefoot
yetithefoot / im-tiff-to-png
Last active April 27, 2018 06:47
convert tiff to png with imagemagick
# memory and map uses to limit memory on slall instances
convert -limit memory 32 -limit map 64 input.tif -units PixelsPerInch -density 72 -quality 80 -resize 1024 output.jpg
sudo apt-get update
sudo apt-get install build-essential checkinstall libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev
sudo apt-get install imagemagick
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar -xzvf ImageMagick.tar.gz
cd ImageMagick-6.8.9-9
./configure
make
sudo make install
@yetithefoot
yetithefoot / gist:c529741623e577bb810d
Created July 21, 2015 12:38
faster mr for picsio
var query = { user: ObjectId("54ef43552e90860000000001"), trashed: { $ne: true } };
function map(){
if(this.tags && this.tags.length) {
var emits = []; // store all future emits. we will unique it later
for(var i=0; i<this.tags.length;i++){
var tag = this.tags[i];
var path = tag.path;
while(path.length){
@yetithefoot
yetithefoot / is-jpg-progressive
Created September 22, 2015 14:19
Identify if jpg is progressive
```identify -verbose file.jpg | grep Interlace```
///If you get back Interlace: JPEG then it’s progressive. It you get back Interlace: None then it’s a baseline (i.e. non-progressive JPEG).
@yetithefoot
yetithefoot / boot.js
Created November 12, 2015 05:19 — forked from jdx/boot.js
zero-downtime node.js app runner
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@yetithefoot
yetithefoot / install-comodo-ssl-cert-for-nginx.rst
Created December 1, 2015 11:29 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@yetithefoot
yetithefoot / gist:74974c3840c195ade897
Created December 10, 2015 06:36 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version