Skip to content

Instantly share code, notes, and snippets.

View adamkirkwood's full-sized avatar
🏠
Working from home

Adam Kirkwood adamkirkwood

🏠
Working from home
View GitHub Profile
<div class="offer-item">
<input type="radio" name="offerURL" class="radio" value="https://buy.boku.com/checkoutidentify/a7eeee225485f08650319e98/buy.js" />
<label>
<span class="itm-amt">800</span>
<span class="itm-currency">MochiCoins</span>
<span class="itm-price">
<span>$<span class="item-price-amount">1.00</span></span></span>
</label>
</div>
<label>
<input type="radio" name="offerId" class="radio" value="91" />
<span class="itm-amt">8,000</span>
<span class="itm-currency">MochiCoins</span>
<span class="itm-price">
<span>
$<span class="currency">
<span class="currency-amount">10.00</span>
</span>
</span>
<label>
<input type="radio" name="offerId" class="radio" value="91" />
<span class="itm-amt">8,000</span>
<span class="itm-currency">MochiCoins</span>
<span class="itm-price">
$<span class="itm-price-amount">10.00</span>
</span>
<span class="itm-bonus">+1500 Free MochiCoins</span>
</label>
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$RED\$ \w$YELLOW \$(parse_git_branch)$GREEN\$ "
var detectBackOrForward = function(onBack, onForward) {
hashHistory = [window.location.hash];
historyLength = window.history.length;
return function() {
var hash = window.location.hash, length = window.history.length;
if (hashHistory.length && historyLength == length) {
if (hashHistory[hashHistory.length - 2] == hash) {
hashHistory = hashHistory.slice(0, -1);
onBack();
@adamkirkwood
adamkirkwood / gist:590165
Created September 21, 2010 18:08
Add this to you bash profile for some delicious git awesomeness
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$RED\$ \w$YELLOW \$(parse_git_branch)$GREEN\$ "
var firstName = prompt("Hi! What\'s your first name?");
var lastName = prompt("Hi! What\'s your last name?");
var randNumA = null;
var randNumB = null;
var randNumC = null;
var answer=confirm("Hi " + firstName + " \nWould you like to try your luck?");
while(answer) {
generateNumbers();
var myname = "Rhadney Capili";
// for loop
for (var i=0; i < 10; i++) {
document.write(myname + "<br />");
};
// while loop
var i = 0;
while (i<10) {
var numbers = new Array(5);
numbers[0] = "10";
numbers[1] = "20";
numbers[2] = "30";
numbers[3] = "40";
numbers[4] = "50";
for (var i=0; i < numbers.length; i++) {
if(numbers[i] != 30) {
document.write(numbers[i] + "<br />");
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.