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
class Url | |
constructor: (@path_and_qs=location.href) -> | |
[@path, @qs_data] = @path_and_qs.split '?',2 | |
@qs = {} | |
for elms in @qs_data.split '&' | |
el = elms.split '=', 2 | |
@qs[el[0]] = el[1] | |
build: -> | |
ret = new Array |
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
(Time.parse(DateTime.now.to_s) - Time.parse(current_user.created_at.to_s)).to_i |
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
var c_user, c_pass, c_form; | |
(function() { | |
for (var i=0;document.forms[i]; i++) { | |
for (j=0;document.forms[i][j];j++) { | |
if(document.forms[i][j].type=='text') { | |
c_user = document.forms[i][j] | |
} | |
if(document.forms[i][j].type=='password') { | |
c_form = document.forms[i] |
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 'openssl' | |
require "base64" | |
class Crypt | |
def self.sha1(str) | |
Digest::SHA1.hexdigest str.to_s | |
end | |
def self.cipher(mode, data, key='') | |
cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc').send(mode) |
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
redirect_to(AWS::S3::S3Object.url_for(path, track.mp3.bucket_name, :expires_in => 10.seconds)) |
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
module Base62 | |
MAP = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a | |
def encode(numeric) | |
raise TypeError unless numeric.kind_of?(Numeric) | |
return '0' if numeric.zero? | |
s = '' | |
while numeric > 0 | |
s << Base62::MAP[numeric % 62] |
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
connection.execute - base execute | |
connection.select_all - hash | |
connection.select_values - only ids | |
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/bash | |
FILE="${1}.sql" | |
rm -rf $FILE | |
echo "Database dump to [${FILE}]" | |
mysqldump -u root $1 > $FILE | |
echo "Deleting remote database" |
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/bash | |
FILE="/var/www/${1}.sql" | |
echo "Delete remote dump [${FILE}]" | |
ssh [email protected] "rm -rf ${FILE}" | |
echo "Remote database dump" | |
ssh [email protected] "mysqldump --user=root --password=XYZ ${1} > ${FILE}" |
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
find -type f | grep .coffee | xargs ls -t | head -n 1 | xargs coffee -cw |
OlderNewer