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
desc "convert a latin1 database with utf8 data into proper utf8" | |
task :convert_to_utf8 => :environment do | |
puts Time.now | |
dryrun = ENV['DOIT'] != '1' | |
conn = ActiveRecord::Base.connection | |
if dryrun | |
def conn.run_sql(sql) | |
puts(sql) | |
end | |
else |
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
/* | |
Author: Qawelesizwe Mlilo | |
Email: [email protected] | |
Dependency: Mootools | |
Notes: This code was used in a Joomla! project and can be easily modified to run without a library | |
*/ | |
var slideShow = function (img, o) { | |
this.element = $(img); | |
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
# setup | |
RewriteEngine on | |
RewriteBase / | |
# product redirection based on iPhone and product request | |
# note: the user agent check is contrived, you should have | |
# a much more robust checker | |
RewriteCond %{HTTP_USER_AGENT} iPhone | |
RewriteCond %{QUERY_STRING} Prodid=(\d+) | |
RewriteRule ^Browse\/Product\.aspx http://m.costco.com/costco/product/productDirectDetail.do?itemId=%1 [R=301,L] |
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 | |
## | |
# MySQL DB dump to Git commit | |
# | |
# Dumps the specified mysql database to the given location and commits it and | |
# the previous database to the Git repository. | |
# | |
# It is assumed you have already setup the Git respository to only be the | |
# a checkout of the database backup location |
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
// General | |
button_tile_map : true, | |
editor_selector : 'lg_mceEditor', | |
mode:'textareas', | |
theme : 'advanced', | |
// Cleanup/Output | |
apply_source_formatting : true, | |
convert_fonts_to_spans : true, | |
convert_newlines_to_brs : false, |
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
Add repo in local gitosis-admin/gitosis.conf | |
~$ mkdir your_repo_name | |
~$ cd your_repo_name | |
~$ git init | |
~$ git remote add origin git@YOUR_SERVER_HOSTNAME:your_repo_name.git | |
# do some work, git add and commit files | |
~$ git add . | |
~$ git commit -m 'Your Message' |