Skip to content

Instantly share code, notes, and snippets.

View AlexKMDev's full-sized avatar

Alex AlexKMDev

View GitHub Profile
@AlexKMDev
AlexKMDev / gist:4b4d8582697f100f3c06
Created January 9, 2015 11:49
install sqlite3 gem on FreeBSD 10.1
CONFIGURE_ARGS="with-sqlite3-include=/usr/local/include with-opt-dir=/usr/local" gem install sqlite3
@AlexKMDev
AlexKMDev / phantomjs.diff
Last active August 29, 2015 14:07
phantomjs reset cache patch
diff --git a/src/consts.h b/src/consts.h
index 0eb5178..0a88ef1 100644
--- a/src/consts.h
+++ b/src/consts.h
@@ -54,6 +54,7 @@
"document.body.appendChild(el);"
#define PAGE_SETTINGS_LOAD_IMAGES "loadImages"
+#define PAGE_SETTINGS_CLEAR_MEMORY_CACHES "clearMemoryCaches"
#define PAGE_SETTINGS_JS_ENABLED "javascriptEnabled"
@AlexKMDev
AlexKMDev / rbenv.sh
Last active August 29, 2015 14:05
rbenv system wide install on linux
git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
@AlexKMDev
AlexKMDev / crontab.sh
Last active August 29, 2015 14:04
homebrew outdated packages notification
# put this to crontab
@daily ~/notify.sh
# for automatic updates (not upgrades)
@daily /usr/local/bin/brew update > /dev/null 2>&1
@AlexKMDev
AlexKMDev / gist:89eb9916eb5b69f62d5f
Last active August 29, 2015 14:03
simple Nginx directory listing
server {
listen 8085;
root /home/debian-transmission/downloads;
charset utf8;
location / {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
@AlexKMDev
AlexKMDev / install_osx.sh
Last active August 29, 2015 14:01
caesaria install script for OS X
#!/bin/sh
LIBDIR=~/Library/Frameworks/
mkdir caesaria
pushd caesaria
curl -C - -OL http://downloads.sourceforge.net/project/opencaesar3/bin/caesaria-mac-b1362.zip
unzip caesaria-mac-b1362.zip
@AlexKMDev
AlexKMDev / Brewfile
Last active August 29, 2015 13:57
System Brewfile
update
upgrade
# beautiful info about system
install archey
# ssh connection with monitoring and autoreconnecting
install autossh
# brew repo for desktop apps
@AlexKMDev
AlexKMDev / rename.sh
Created March 6, 2014 17:20
add newline to list of files
#!/bin/sh
for file in $(cat list.txt); do sed -i '' -e '$a\' $file; done
@AlexKMDev
AlexKMDev / backup.sh
Last active August 29, 2015 13:57
reinstall homebrew packages
#!/bin/sh
BACKUP_PATH=/tmp/packages_list
brew ls > $BACKUP_PATH
brew rm $(cat $BACKUP_PATH)
brew install $(cat $BACKUP_PATH)
rm $BACKUP_PATH
brew cleanup -s
@AlexKMDev
AlexKMDev / some_spaghetti_code.js
Last active December 17, 2015 10:49
country list with codes in russian from http://www.artlebedev.ru/tools/country-list/
'AB' => 'Абхазия',
'AU' => 'Австралия',
'AT' => 'Австрия',
'AZ' => 'Азербайджан',
'AL' => 'Албания',
'DZ' => 'Алжир',
'AS' => 'Американское Самоа',
'AI' => 'Ангилья',
'AO' => 'Ангола',
'AD' => 'Андорра',