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
<h1>Shorty URL Now!!</h1> | |
<%= form_for :i_shorty, :url =>"/ishorty", :as => :post do |f|%> | |
<%= f.label "URL" %>: | |
<%= f.text_field :long_url %> | |
<%= f.submit "shorten", :name => "shorten_button", :id => "shorten_button" %> | |
<% 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
<% | |
Dim app_id, app_secret, token_url, access_token | |
app_id = "APP_ID" | |
app_secret = "APP_SECRET" | |
token_url = "https://graph.facebook.com/oauth/access_token?"&"client_id="&app_id&"&client_secret="&app_secret&"&grant_type=client_credentials" | |
Function GetTextFromUrl(url) |
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
#! usr/bin/env ruby | |
require "rubygems" | |
require 'json' | |
require "open-uri" | |
require "hpricot" | |
ticket_details_url = "http://www.wegottickets.com/searchresults/page/1/all" | |
message_response = "" |
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
DATE AND TIME FORMAT CODES | |
To Configure the Date/Time Display: | |
VIEW → GLOBAL OPTIONS → DISPLAY TAB | |
TOOLS → GLOBAL OPTIONS → DISPLAY TAB (VER 2.9.X) | |
Change the Time Format according to the codes listed below. | |
%a Abbreviated weekday name | |
%A Full weekday name | |
%b Abbreviated month name | |
%B Full month name | |
%c Date and time representation for your locale |
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
<? | |
$items = 7; | |
$incoming = file_get_contents(APP_DOCROOT . "/cache/brainfood.cache.xml"); | |
//$xml = iconv("GB18030", "utf-8", $incoming); | |
//$simple = simplexml_load_file($xml,'SimpleXMLElement', LIBXML_NOCDATA); | |
$simple = preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $incoming); | |
$simple = simplexml_load_string($simple); | |
?> |
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
$('.cat_list :checkbox').click(function() { | |
var $c = this.checked; | |
$(this).closest('li').find(':checkbox').attr('checked',$c); | |
}); |
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
<!--[if gte IE 9]> <script type="text/javascript"> Cufon.set('engine', 'canvas'); </script> <![endif]--> |
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
sudo mkdir -p /usr/local/src | |
sudo curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.tar.gz | |
cd /usr/local/src | |
tar xvzf pcre-8.02.tar.gz | |
cd pcre-8.02 | |
./configure --prefix=/usr/local | |
make | |
sudo make install |
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
type Transformer = Request => Request | |
object OptimusPrime extends Transformer { def apply(req: Request) = req } | |
object Megatron extends Transformer { def apply(req: Request) = throw new RuntimeException("Invalid operation!")} |
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
wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash | |
mv git-completion.bash ~/.git-completion.bash | |
cd ~/ | |
vim .profile | |
#add the following into .profile | |
# Add git bash completions | |
source ~/.git-completion.bash | |
GIT_PS1_SHOWDIRTYSTATE=1 |