This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.modal') | |
.on('shown', function(){ | |
$('body').css({overflow: 'hidden'}); | |
}) | |
.on('hidden', function(){ | |
$('body').css({overflow: ''}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "github_api" | |
user = '' | |
token = '' | |
github = Github.new oauth_token: token | |
coderwall_orgs = [] | |
github.orgs.list.each do |org| | |
coderwall_orgs << org.login if org.login =~ /^coderwall/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.open 'zip_codes.csv', 'r' | |
content = file.read | |
lines = content.split '>"' | |
output = '' | |
lines.each do |l| | |
begin | |
values = l.split ',"' | |
coordinates = values[1]. | |
delete!("<Polygon><outerBoundaryIs><LinearRing><coordinates>"). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo update-alternatives --config x-www-browser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This pre-push hook will run 'rake' command to check if your test | |
# suite passes by looking for ', 0 failures' in the 'rake' output | |
# If found, will return exit and the git push command will continue | |
# Make sure you remove the .sh extension and put the hook into your | |
# .git/hooks directory in your project | |
# -------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rand_port(){ | |
port=$(( 1000+( $(od -An -N2 -i /dev/random) )%(1023+1) )) | |
while : | |
do | |
(echo >/dev/tcp/localhost/$port) &>/dev/null && port=$(( 1000+( $(od -An -N2 -i /dev/random) )%(1023+1) )) || break | |
done | |
echo "$port" | |
} | |
phpmin(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script verifies if a list of "undesired" words are presented in the files you are intented to commit such console | |
# output, debugging information or keys/tokens/passwords | |
# Based on the git hook created by Mark Story | |
# http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes | |
# Instructions: | |
# Put this file into your .git/hooks folder and remove the .sh extension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Djisktra: https://gist.github.com/FerPerales/10e032e8db71b6918676 | |
CLasses and metaprogramming: https://gist.github.com/FerPerales/4584a82ed5c6beea1900 | |
Recorder: https://gist.github.com/FerPerales/91032e5b539b2c1a8bb5 | |
Temperature: https://gist.github.com/FerPerales/48da2857202dc7343158 | |
Demo store: https://github.com/FerPerales/demo-store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- turn off screen keybidding --> | |
<keybind key="XF86Launch1"> | |
<action name="Execute"> | |
<command>xset dpms force off</command> | |
</action> | |
</keybind> | |
<!-- end turn off screen keybidding --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A small script to install hstore module in Ubuntu | |
# Dependencies: | |
# | |
# * Please make sure you have installed postgres-contrib package | |
# | |
# How to customize this script: | |
# | |
# * Modify the path (you may require to change the postresql version) | |
# * If you are not using the default postgresql username and password, | |
# * change it (default username is postgres and no password) |