Skip to content

Instantly share code, notes, and snippets.

View saippuakauppias's full-sized avatar
🤔
/dev/random

Denis Veselov saippuakauppias

🤔
/dev/random
View GitHub Profile
@saippuakauppias
saippuakauppias / social_counts.js
Last active September 22, 2021 12:41
Get shares counts from social networks
$(document).ready(function() {
var location = document.location.href;
// fb
$.getJSON(
"http://graph.facebook.com/" + location + "&callback=?",
function(data) {
if(data.shares == undefined) {fb_shares = 0} else {fb_shares = data.shares}
$("#fb_soc_counter").html(fb_shares);
}
@saippuakauppias
saippuakauppias / gist:3482573
Created August 26, 2012 18:55
My Sublime Text 2 User Preferences
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"font_size": 12.0,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"highlight_line": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "Cyrillic (Windows 1251)",
"highlight_modified_tabs": true,
@saippuakauppias
saippuakauppias / gist:3430432
Last active December 28, 2021 02:51
git shortcuts + zshrc
function git_current_branch () {
local ref
ref="$(git symbolic-ref --quiet HEAD 2>/dev/null)"
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return 0
ref=$(git rev-parse --short HEAD 2>/dev/null) || return 0
fi
echo "${ref#refs/heads/}"
@saippuakauppias
saippuakauppias / install.sh
Last active September 30, 2015 00:48 — forked from nyumatova/install.sh
Virtualenv
sudo apt-get -y install git
sudo apt-get -y install curl
sudo apt-get -y install python-dev
sudo apt-get -y install libjpeg8-dev
sudo apt-get -y install libfreetype6-dev
curl http://python-distribute.org/distribute_setup.py | sudo python
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
sudo pip install virtualenv
@saippuakauppias
saippuakauppias / gist:1567534
Created January 5, 2012 21:54
Arduino door opener
// Библиотеки для работы с дисплеем
#include <LiquidCrystal.h>
#include <LiquidCrystalRus.h>
// Цифровые PINы - кнопки
const int button1 = 10;
const int button2 = 9;
const int button3 = 8;
const int button4 = 7;
const int button5 = 6;