Skip to content

Instantly share code, notes, and snippets.

View jasperkennis's full-sized avatar
💨
CODING

Jasper Kennis jasperkennis

💨
CODING
View GitHub Profile
@jasperkennis
jasperkennis / dictkeys
Created September 3, 2014 08:04
Python object types as dict key demo
return {
Country: self.fetch_country(city),
Region: self.fetch_region(city),
City: self.fetch_city(city),
None: None
}[type(location)]
getFormattedDate = ->
date = new Date()
date.getMonth() + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes()
resetPullHeader = ->
actInd.hide()
imageArrow.transform = Ti.UI.create2DMatrix()
if refreshCount < 2
imageArrow.show()
labelStatus.text = "Pull down to refresh..."
labelLastUpdated.text = "Last Updated: " + getFormattedDate()
# By Oto Brglez - @otobrglez
# Rake task. Put in your (lib/tasks) folder of your Rails application
# Execute with "rake dropbox:backup"
# Configuration must be inside config/dropbox.yml file
namespace :dropbox do
desc "Backup production database to dropbox"
task :backup do
@jasperkennis
jasperkennis / set-cookie.js.coffee
Created October 24, 2012 14:57
Simple function to quickly set a cookie. The function is attached to window so you can call it anywhere once it's loaded.
# config/initializers/active_admin.rb
ActiveAdmin.setup do |config|
# All the ActiveAdmin config stuf
end
Dir[ File.join(Rails.root, "lib", "active_admin_extentions", "*.rb") ].each {|l| require l }