View metadata.json
This file contains 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
{ | |
"support": "github.com/NARKOZ/SponsorMe", | |
"linkedin": "linkedin.com/in/nihadabbasov", | |
"stackoverflow": "stackoverflow.com/users/159721", | |
"stackexchange": "stackexchange.com/users/53440?tab=accounts", | |
"gpg_key": "gist.githubusercontent.com/NARKOZ/4f6b23904dfec1d0c02bacf075fa8126/raw/9BD324DE.asc" | |
} |
View 9BD324DE.asc
This file contains 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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBFrstzUBEACtbraAtSU9POTjSfl8VQV7VEB8tepxLrOAoYeVXmEEY8s37Gtz | |
oSp8BYerTVi6S0hTV8e/UvbZ7BbUFyWI9YilWNgxwULIaie9M5FFIA0eahHyivrc | |
4xVEzspdakX2Ku/vKULAzcvYbzBVMcBHQO2kjAmGPLznEhvqt9oM7KpRhoSj8Hq/ | |
KNPsZDJ540Q4cYup6PLStx+HYW/0CUpa9RxEjA8TXsGZbDUgHJRdh2FEaGMCiziI | |
IhVQki9gcOz1tE6Oea9P3tbovdCzOJdyc/QyMC3QafD/JI373eKbuyaSvToFAP3p | |
BE5p+U3jsxpN/3yY3DJt0S8heeEs6R3KBf/BHbJiOS95PfiMKa6O6hAUOtXYy66o | |
PzcxCzwpVynyQRljb46gPjTlaI6WNAp6SbcvCNXjEqOrMkuaoCqLJkdV9U10GNt/ | |
YVTnsmzmV6Dyw9/U1sDNKF2YjXROKQ+kyr8JCzd16vUsPmAtpNPYdCeiQFFOCFSm |
View jquery.browser.js.coffee
This file contains 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
# Restores `$.browser` functionality removed in jQuery 1.9 | |
jQuery.uaMatch = (ua) -> | |
ua = ua.toLowerCase() | |
match = /(chrome)[ \/]([\w.]+)/.exec(ua) or | |
/(webkit)[ \/]([\w.]+)/.exec(ua) or | |
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) or | |
/(msie) ([\w.]+)/.exec(ua) or | |
ua.indexOf("compatible") < 0 and /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) or [] | |
browser: match[1] or '' | |
version: match[2] or '0' |
View gist:4294977
This file contains 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
# gem 'mini_magick' 5217dfe | |
# GraphicsMagick 1.3.17 | |
# ImageMagick 6.7.0-10 | |
# Resize to fill (old method) | |
# http://www.imagemagick.org/Usage/resize/#space_fill | |
# | |
# works with ImageMagick as expected | |
# fails to work with GraphicsMagick as expected |
View evaluation.rb
This file contains 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
def evaluation_value(reputation_name, source, *args) | |
scope = args.first | |
srn = ReputationSystem::Network.get_scoped_reputation_name(self.class.name, reputation_name, scope) | |
evaluation = RSEvaluation.find_by_reputation_name_and_source_and_target(srn, source, self) | |
evaluation.present? ? evaluation.value : 0 | |
end | |
def has_evaluation?(reputation_name, source, *args) | |
scope = args.first | |
srn = ReputationSystem::Network.get_scoped_reputation_name(self.class.name, reputation_name, scope) |
View whitespace.rake
This file contains 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
# requires BSD sed | |
namespace :whitespace do | |
desc 'Removes trailing whitespace' | |
task :cleanup do | |
sh %{for f in `find . -type f | grep -v .git | grep -v ./vendor | grep -v ./tmp | egrep ".(rb|js|haml|html|css|sass)"`; | |
do sed -i '' 's/ *$//g' "$f"; | |
done}, {:verbose => false} | |
puts "Task cleanup done" | |
end |
View gist:842156
This file contains 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/bash | |
while [[ true ]]; do | |
STOREDOWN=`curl -s http://store.apple.com/us | grep backsoon` | |
if [ "$STOREDOWN" = "" ]; then | |
/usr/local/bin/growlnotify "Apple store is up!" -m "Let' see what's new" |
View db_backup.sh
This file contains 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/bash | |
# Shell script to backup MySQL database | |
# Set these variables | |
MyUSER="" # DB_USERNAME | |
MyPASS="" # DB_PASSWORD | |
MyHOST="" # DB_HOSTNAME | |
# Backup Dest directory | |
DEST="" # /home/username/backups/DB |
NewerOlder