Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Loading status...

Vlad Tsepelev yetithefoot

:octocat:
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;
while(path.length){
View imagemagick_install.sh
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 / 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
View zsh.md

Prereq:

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 https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@yetithefoot
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.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 / Medical spambot blacklist
Last active Aug 29, 2015
Spambot submitting medical ads (viagra, tramadol etc.)
View Medical spambot blacklist
96.47.224.218
96.47.224.42
96.47.224.50
96.47.224.58
96.47.225.162
96.47.225.170
96.47.225.178
96.47.225.186
96.47.225.66
96.47.225.74
@yetithefoot
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
yetithefoot / parsecom2csv
Created Dec 26, 2013
Retrieves Parse.com object, filter it and converts to CSV(without header)
View parsecom2csv
# converts Parse.com json object presentation to CSV with simple filtering
# dependency - jq command line tool
# NOTE: Parse.com API does not allow to get more than 1000 records per request, so you need to vary skip and limit params
# https://www.parse.com/docs/rest#general-quick
# NOTE: Also you can download exported Parse.com backup (Parse.com\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 https://api.parse.com/1/classes/Email\?skip=0\&limit=1000 -s` | jq '.results[] | .email +","+.type +","+ .createdAt'
@yetithefoot
yetithefoot / chrome-enable-logging
Last active Jun 21, 2020
Runs Google Chrome with logging
View chrome-enable-logging
# enable Chrome logging
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging=stderr --v=1
You can’t perform that action at this time.