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
$.ajax({ | |
type : 'GET', | |
url : 'http://twitvangelist.kohsrv.net/leaderboard/combined.json', // this will give you the combined tweets and leaderboard | |
dataType : 'JSONP', | |
jsonpCallback : 'callbackfunction', | |
success : function(results) { | |
console.log(results.top3); // this will give you the top 3 from the leaderboard | |
console.log(results.tweets); // this will give you the a list of tweets with the hashtag |
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> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="language" content="en" /> | |
<title>kohactive | a creative digital company</title> | |
<meta name="robots" content="noindex,nofollow " /> |
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
$(document).ready(function() { | |
var topspeed = 1; | |
var midspeed = 1; | |
var bgspeed = 1; | |
var bgfactor = .1; | |
var distanceFactor = 1.2; | |
var useDistance = true; | |
if (!$.browser.webkit) { |
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
module CommonScopes | |
def self.included(base) | |
base.class_eval { | |
# Filtering by the state of the record | |
scope :active, where(:parent_id => nil, :deleted_at => nil) #.order('sort_order asc') | |
scope :published, where('published_at IS NOT NULL', :deleted_at => nil) | |
scope :unpublished, where(:published_at => nil, :deleted_at => nil) |
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
# takes a string and will return the same string but with email addresses encoded and hyperlinked | |
def emailitize text | |
text.gsub(/([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})/i) {|m| | |
mail_to(m, m.gsub("@", "[at]"), :encode=>:hex) | |
} | |
end |
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
class Array | |
# Given an Array, find if a value exists for a given key. This is helpful in our settings | |
# since we cache the entire settings array, but occasionally we wan to find a specific | |
# setting, i.e. "Site Title", "Posts per page", etc.... | |
# USAGE::: array.find_value? "key", "Value is Case Sensitive" | |
def find_value key, value | |
if self.first.respond_to? key.parameterize.underscore.to_sym | |
self.select { |item| item.send(key.parameterize.underscore) == value }.first rescue nil |
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
# Create a rake task that sends the message using Twilio. You'll | |
# need a Twilio SID and Token as well as number | |
namespace :sms do | |
desc "Send SMS message" | |
task :send, [:message] => [:environment] do |t, args| | |
client = Twilio::REST::Client.new TWILIO_SID, TWILIO_TOKEN | |
client.account.sms.messages.create( | |
from: TWILIO_NUMBER, | |
to: PHONE_NUMBER, | |
body: args[:message] |
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
# In your deploy.rb add the following code. This will run the rake task | |
# when deployment beings | |
before :deploy do | |
run_locally 'rake sms:send["We\'re doing the thing - kohbot"]' | |
end | |
# And then send another after the deployment is over | |
after :deploy do | |
run_locally 'rake sms:send["The thing is over :( - kohbot)"]' | |
end |
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
// Main containers | |
.container | |
@include outer-container | |
// Rows | |
.row | |
@include row() | |
// A basic column without a defined width or height |
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
# Patch for Date and Time that adds a conveneince method for identifying | |
# if a date is within this year | |
# config/initializers/date_time.rb | |
class Date | |
def this_year? | |
self.year == ::Date.current.year | |
end | |
end |
OlderNewer