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
<?php | |
class DateTime extends \DateTime | |
{ | |
private static $DATE_NAMES = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); | |
private static $FORMATS = array('ymd' => 'Y-m-d', 'jenark' => 'm/d/y', 'mysql' => 'Y-m-d'); | |
private static $DEFAULT_FORMAT = 'ymd'; | |
public function __call($method, $args) | |
{ | |
if (substr($method, 0, 2) === "is" && in_array(substr($method, 2), self::$DATE_NAMES)) |
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
# encoding: utf-8 | |
class AvatarUploader < CarrierWave::Uploader::Base | |
# Include RMagick or ImageScience support: | |
# include CarrierWave::RMagick | |
# include CarrierWave::ImageScience | |
# Choose what kind of storage to use for this uploader: | |
storage :file |
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
def self.define_scopes(&block) | |
class_eval do | |
missing = method(:method_missing) | |
undef :method_missing | |
def self.method_missing(method, *args, &block) | |
scope method, block | |
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
#!/bin/bash | |
# CentOS rbenv system wide installation script | |
# Forked from https://gist.github.com/1237417 | |
# Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
# Install pre-requirements | |
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
make bzip2 autoconf automake libtool bison iconv-devel git-core |
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
require 'bundler/setup' | |
Bundler.setup | |
require "eventmachine" | |
require "em-websocket" | |
EM.run do | |
channel = EM::Channel.new | |
EM::WebSocket.start(host: "0.0.0.0", port: 2092, debug: true) do |ws| | |
ws.onopen do |
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
Zombie = require "zombie" | |
assert = require("chai").assert | |
$ = require "jquery" | |
describe "When first visiting the time entry page", -> | |
before (done) -> | |
@browser = new Zombie | |
@browser.visit("http://localhost:4567").then done, done |
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
drawLandmarks: function() { | |
var parent = this; | |
var createListenter = function(shapeMarker, landmark) { | |
google.maps.event.addListener(shapeMarker, 'click', function() { | |
parent.setLocation('activity', landmark.id, landmark.name, shapeMarker); | |
}); | |
} | |
for (var i = 0, landmark; landmark = this.landmarkData[i]; i++) { | |
if(landmark.type == "circle") { |
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
--type-add=ruby=.ru | |
--type-set=haml=.haml | |
--type-set=sass=.sass,.scss | |
--type-add=html=.haml | |
--type-add=css=.sass,.scss | |
--type-add=html=.tpl |
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
#!/bin/sh | |
bundle install --binstubs | |
bundle exec rake db:drop RAILS_ENV=development | |
bundle exec rake db:drop RAILS_ENV=test | |
bundle exec rake db:create:all | |
bundle exec rake db:setup | |
bundle exec rake db:development:accounts | |
echo " |
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
require 'rack' | |
require 'sinatra/base' | |
class App < Sinatra::Base | |
use Rack::Static, :urls => ["/js"], :root => '.' | |
not_found do | |
halt 404, "nawp" | |
end |
OlderNewer