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
#!/usr/bin/ruby | |
if ENV['GIT_DIR'] == '.' | |
Dir.chdir('..') | |
ENV['GIT_DIR'] = '.git' | |
end | |
old_head, new_head, ref = STDIN.gets.split | |
puts ref | |
`echo \"#{ ref }\" >> head.txt` | |
if ref == "refs/heads/prod" |
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
// jQuery to scroll to a target element | |
var x = $(ELEMENT).offset().top - 100; | |
$('html,body').animate({scrollTop: x}, 500); |
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
# mongo_template.rb | |
# remove unneeded defaults | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
run "rm public/javascripts/controls.js" | |
run "rm public/javascripts/dragdrop.js" | |
run "rm public/javascripts/effects.js" | |
run "rm public/javascripts/prototype.js" |
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
static void Main(string[] args) | |
{ | |
for (int i = 0; i < 10; i++) | |
{ | |
var token = | |
BitConverter.ToString(SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes(Guid.NewGuid().ToString()))) | |
.Replace("-", "").Substring(8, 12).ToLower(); |
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
server { | |
listen 80; | |
server_name www.mysite.com mysite.com; | |
rewrite ^/(.*) http://iwalkthevine.com permanent; | |
} |
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
--'First Day of Last Month, and Last Day of Last Month' | |
declare @MyDate smalldatetime | |
set @MyDate = DATEADD(Month, -1, GETDATE()) | |
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)-1),@mydate),101) | |
set @MyDate = GETDATE() | |
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)),@mydate),101) |
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
<?xml version="1.0"?> | |
<root | |
xmlns="urn:ChirpyConfig" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="urn:ChirpyConfig chirp.xsd"> | |
<FileGroup Name="public/css/application.css" Minify="false"> | |
<Folder Pattern="assets/css/*.min.css" /> | |
</FileGroup> |
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
private dynamic CallRestService(string uri, string method, dynamic parms) { | |
dynamic result; | |
var req = HttpWebRequest.Create(uri); | |
req.Method = method; | |
req.ContentType = "application/json"; | |
byte[] bytes = UTF8Encoding.UTF8.GetBytes(parms.ToString()); | |
req.ContentLength = bytes.Length; | |
using (var stream = req.GetRequestStream()) { |
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
<!doctype html> | |
<head> | |
<title>Hi</title> | |
<style> | |
#spin { | |
background: #333; | |
color: white; | |
float: left; | |
width: 200px; | |
height: 200px; |
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
<script type="text/javascript"> | |
$(document).ready(function () { | |
var settngs = $.data($('form')[0], 'validator').settings; | |
settngs.onfocusout = function (element) { $(element).valid(); }; | |
}); | |
</script> | |
options: { // options structure passed to jQuery Validate's validate() method | |
errorClass: "input-validation-error", | |
errorElement: "span", |
OlderNewer