Skip to content

Instantly share code, notes, and snippets.

Loading status...

Vlad Tsepelev yetithefoot

Loading status...
View GitHub Profile
View gist:c529741623e577bb810d
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;
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
tar -xzvf ImageMagick.tar.gz
cd ImageMagick-6.8.9-9
sudo make install
yetithefoot / im-tiff-to-png
Last active Apr 27, 2018
convert tiff to png with imagemagick
View im-tiff-to-png
# 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


apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget -O - | zsh
yetithefoot / chrome-enable-memory
Last active Jun 21, 2020
Runs Google Chrome with memory objects
View chrome-enable-memory
To enable window.gc() on Chrome browser console you just need to start Chrome like this:
> /Applications/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 / Medical spambot blacklist
Last active Aug 29, 2015
Spambot submitting medical ads (viagra, tramadol etc.)
View Medical spambot blacklist
yetithefoot / github-labels-sort
Created Feb 12, 2014
sort github issue labels
View github-labels-sort
(function sort_labels(){
var issues = document.querySelector(".color-label-list");
var issue_1hrs = issues.querySelector("li[data-name='1hrs']");
var issue_2hrs = issues.querySelector("li[data-name='2hrs']");
var issue_4hrs = issues.querySelector("li[data-name='4hrs']");
var issue_8hrs = issues.querySelector("li[data-name='8hrs']");
var issue_30min = issues.querySelector("li[data-name='30min']");
var issue_backend = issues.querySelector("li[data-name='backend']");
var issue_frontend = issues.querySelector("li[data-name='frontend']");
yetithefoot / parsecom2csv
Created Dec 26, 2013
Retrieves object, filter it and converts to CSV(without header)
View parsecom2csv
# converts json object presentation to CSV with simple filtering
# dependency - jq command line tool
# NOTE: API does not allow to get more than 1000 records per request, so you need to vary skip and limit params
# NOTE: Also you can download exported backup (\Settings\Export) and read via "cat filename | jq '.'".
echo `curl -H 'X-Parse-Application-Id: <PASTE_YOUR_APP_ID_HERE>' -H 'X-Parse-REST-API-Key: <PASTE_YOUR_REST_API_KEY_HERE>' -H 'Content-Type: application/json' -L\?skip=0\&limit=1000 -s` | jq '.results[] | .email +","+.type +","+ .createdAt'
yetithefoot / chrome-enable-logging
Last active Jun 21, 2020
Runs Google Chrome with logging
View chrome-enable-logging
# enable Chrome logging
/Applications/Google\\ Chrome --enable-logging=stderr --v=1
You can’t perform that action at this time.