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
location /socket.io { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; |
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 TransactionItem < ActiveRecord::Base | |
has_many :transaction_bucket_item_links | |
before_save :sub_account_balance | |
before_destroy :sub_account_balance, :destroy_links | |
after_save :add_account_balance | |
def destroy_links | |
TransactionBucketItemLink.destroy(:all, ["transaction_item_id = ?", self.id]) | |
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
Alexs-MacBook-Pro:rv8 sikanrong$ git remote -v | |
origin git@bitbucket.org:sikanrong/rv8.git (fetch) | |
origin git@bitbucket.org:sikanrong/rv8.git (push) | |
upstream git@bitbucket.org:restoin/rv8.git (fetch) | |
upstream git@bitbucket.org:restoin/rv8.git (push) | |
Alexs-MacBook-Pro:rv8 sikanrong$ git pull upstream market | |
From bitbucket.org:restoin/rv8 | |
* branch market -> FETCH_HEAD | |
Already up-to-date. | |
Alexs-MacBook-Pro:rv8 sikanrong$ git push upstream market |
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 | |
#Alex Pilafian - Zeller Algorithm. 2015 | |
#https://docs.google.com/document/d/1BKHrV0SEhblnPUgcISKV1oIJ8ejC6jjhtXs_jX8CbWU/edit | |
$days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] | |
print "Enter your date of birth (dd/mm/yyyy):\n" | |
input = gets.chomp |
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 | |
#Alex Pilafian - "Manchester United"-themed data parsing program. 2015 | |
#https://docs.google.com/document/d/1NWtzQj1irzL86cv3A48HVxWdT2tRpJw7UQ8dWYHaHgA/edit?usp=drive_web | |
#The $-sign just denotes a global variable. | |
$scores = "Manchester United 1 Chelsea 0, Arsenal 1 Manchester United 1, Manchester United 3 Fulham 1, Liverpool 2 Manchester United 1, Swansea 2 Manchester United 4" | |
def is_number?(str) |
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
scores = "Manchester United 1 Chelsea 0, Arsenal 1 Manchester United 1, Manchester United 3 Fulham 1, Liverpool 2 Manchester United 1, Swansea 2 Manchester United 4" | |
games_won = 0 | |
games_lost = 0 | |
games_drawn = 0 | |
goals_scored = 0 | |
goals_conceded = 0 | |
scores_array = scores.split(",") |
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
var animate = function(){ | |
var frameDuration = 1000; //milliseconds | |
var my = this; | |
setTimeout(function(){ | |
//do animate stuff here. Use "my" in place of "this" to access the outer object scope within the setTimeout function, if needed. | |
animate(); //re-calls itself. | |
}, frameDuration); | |
} |
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> | |
<body> | |
<script type="text/javascript"> | |
var newDiv = $('<div/>', { | |
id: 'elementID', | |
class: 'className' | |
}).appendTo('body'); | |
</script> | |
</body> | |
</html> |
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
zE(function(){$zopim(function(){ | |
$zopim.livechat.window.setOffsetHorizontal(100); | |
$zopim.livechat.window.setOffsetVertical(200); | |
});}); | |
zE(function(){$zopim(function() { | |
$zopim.livechat.setLanguage('sv'); | |
})}); | |
zE(function(){$zopim(function() { |
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
{ | |
"cities": [ | |
{ | |
"name": "Madrid", | |
"Country": 1, | |
"lat": 40.429203, | |
"lng": -3.694986 | |
}, | |
OlderNewer