Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Loading status...

Vlad Tsepelev yetithefoot

:octocat:
Loading status...
View GitHub Profile
View UIImage+AverageColor
@implementation UIImage (AverageColor)
- (UIColor *)averageColor {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
unsigned char rgba[4];
CGContextRef context = CGBitmapContextCreate(rgba, 1, 1, 8, 4, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
CGContextDrawImage(context, CGRectMake(0, 0, 1, 1), self.CGImage);
CGColorSpaceRelease(colorSpace);
View grayscale.css.fs
/*
Copyright 2012 Adobe Systems, Incorporated
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License http://creativecommons.org/licenses/by-nc-sa/3.0/ .
Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe http://www.adobe.com/communities/guidelines/ccplus/commercialcode_plus_permission.html .
*/
precision mediump float;
// This uniform value is passed in using CSS.
uniform float value;
View Chef initial for clean Ubuntu 12.04 LTS
apt-get update
apt-get install -y build-essential libssl-dev zlib1g-dev wget
apt-get remove -y libruby1.8 ruby1.8 ruby1.8-dev rubygems
rm -f /usr/bin/gem
apt-get install -y ruby1.9.1 ruby1.9.1-dev libruby1.9.1
gem update --no-rdoc --no-ri -y
gem install ohai --no-rdoc --no-ri --verbose
gem install chef --no-rdoc --no-ri --verbose
gem install knife-solo --no-rdoc --no-ri --verbose
@yetithefoot
yetithefoot / blinking.css
Created Nov 15, 2013
Css blinking style. Just add this class to element you want to blink.
View blinking.css
.blinking {
animation-name: blinker;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
-webkit-animation-name: blinker;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
@yetithefoot
yetithefoot / stuns
Last active Aug 9, 2020 — forked from zziuni/stuns
STUN+TURN servers list
View stuns
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@yetithefoot
yetithefoot / ip-geolocate
Created Dec 19, 2013
IP Geolocation shell script
View ip-geolocate
# Uses curl for getting location object from telize.com
# Next it uses jq (http://stedolan.github.io/jq/) json parser to extract city and country name
# get current location name based on request IP
curl -s http://www.telize.com/geoip | jq '.city +", "+ .country'
# get location name based on parameter value from request
curl -s http://www.telize.com/geoip/8.8.8.8 | jq '.city +", "+ .country'
@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
@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 / 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 / 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
You can’t perform that action at this time.