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
class CreateMerchantUniqIdGens < ActiveRecord::Migration | |
def change | |
create_table :merchant_uniq_id_gens do |t| | |
t.integer :count, :null => false | |
end | |
# Set initial count to 100 | |
single_row = MerchantUniqIdGen.new | |
single_row.count = 100 | |
single_row.save! |
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
module MyAppEncryptor | |
app = Rails.application | |
config = app.config | |
# PBKDF2 with SHA-1 | |
key_generator = ActiveSupport::KeyGenerator.new(app.secrets[:secret_key_base], iterations: 1000) | |
secret = key_generator.generate_key(config.action_dispatch.encrypted_cookie_salt) | |
sign_secret = key_generator.generate_key(config.action_dispatch.encrypted_signed_cookie_salt) |
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
module RandomAlphaNumeric | |
@deck = [(0..9), ('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten | |
def self.generate(length) | |
@deck.shuffle[0, length].join | |
end | |
end |
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
<style type="text/css"> | |
.top { | |
margin-top: 10px; | |
} | |
.heading { | |
font-weight: bold; | |
font-size: 22px; | |
text-align: left; | |
color: #1788DC; |
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
<html> | |
<head> | |
<link href="css/screen.css" rel="stylesheet" type="text/css"/> | |
<link href="css/ie.css" rel="stylesheet" type="text/css"/> | |
<link href="css/print.css" rel="stylesheet" type="text/css"/> | |
<style type="text/css"> | |
.top { | |
margin-top: 10px; | |
} |
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
<script src="js/jquery-1.4.min.js" type="text/javascript"></script> | |
<script src="js/cufon-yui.js" type="text/javascript"></script> | |
<script src="js/fonts/vanilla.cufonfonts.js" type="text/javascript"></script> | |
<script> | |
$(document).ready(function() { | |
Cufon.replace($(".heading")); | |
}); | |
</script> |
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
wkhtmltopdf sample-brochure.html sample-brochure.pdf |
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
<html> | |
<head> | |
<link href="css/screen.css" rel="stylesheet" type="text/css"/> | |
<link href="css/ie.css" rel="stylesheet" type="text/css"/> | |
<link href="css/print.css" rel="stylesheet" type="text/css"/> | |
<style type="text/css"> | |
.top { | |
margin-top: 10px; | |
} |
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
apt-get install dictd | |
apt-get install dict-gcide | |
apt-get install dict-moby-thesaurus | |
"Application -> Office -> Dictionary -> Edit –> Preference -> Add" | |
Description : <<Your description>> | |
Transport : Dictionary Server | |
Hostname : 127.0.0.1 | |
Port : 2628 |
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
####### Machine A ########### | |
# create package index file | |
cd /var/cache/apt/archives/ | |
dpkg-scanpackages . /dev/null | gzip -c -9 > Packages.gz | |
# start mongoose (code.google.com/p/mongoose) / any webserver with document root as "/var/cache/apt/archives/" | |
mongoose -r /var/cache/apt/archives/ | |
####### Machine B ########### | |
# edit " /etc/apt/sources.list" |
OlderNewer