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
<div> | |
<div data-addclass-error="channel.errors['name'].length"> | |
<label for="channel_title">Name:</label> | |
<div class="input"> | |
<input data-bind="channel.name" name="channel[name]" id="channel_title"/> | |
</div> | |
</div> | |
<div> | |
<ul> |
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
edit: (params) -> | |
@set 'channel', Ems.Channel.find parseInt(params.id), (err) -> throw err if err | |
Ems.Category.load (err, categories) => | |
throw err if err | |
@set 'categories', categories | |
console.log 'Categories returned: ', categories | |
# RETURNS: | |
# | |
# > Categories returned: [ Category, Category, Category ] |
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
<div class="gist"> | |
<a href= | |
"https://gist.github.com/1870642.js?file=resque.rake">https://gist.github.com/1870642.js?file=resque.rake</a> | |
</div> |
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
module Engine | |
def initialize | |
@engine_running = false | |
end | |
def start_engine | |
@engine_running = true | |
end | |
def stop_engine |
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
# Mixin to aid the compilation of routes | |
# | |
# PLEASE NOTE, this does not work with collections or nested routes/resources | |
# | |
# @mixin | |
# @author Vincent Siebert <[email protected]> | |
# @copyright (c) 2012 The Beans Group Ltd | |
Batman.mixin Batman.Filters, | |
# Filter to aid the compilation of non CRUD routes. Unfortunately because there is no way of resolving a keypath in an object when passing |
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 | |
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
$msg = "<22>" . date('M j H:i:s ') . $program . ' ' . $component . ': ' . $message; | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
# replace these with settings provided by Papertrail | |
socket_sendto($sock, $msg, strlen($msg), 0, 'logs.papertrailapp.com', 1111); | |
socket_close($sock); | |
} |
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 Xyz.TestModel extends Batman.Model | |
save: (options, callback) -> | |
super options, (err, record, env) => | |
console?.log record | |
testModel = new Xyz.TestModel() | |
testmodel.save null, (err) -> |
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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
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 | |
require 'fileutils' | |
require 'tempfile' | |
def replace_in_file(filename,oldvalue,newvalue) | |
temp_file = Tempfile.new(File.basename(filename)) | |
contents = File.read(filename) | |
changed_contents = contents.gsub(oldvalue,newvalue).gsub(oldvalue.downcase,newvalue.downcase) | |
temp_file.print(changed_contents) |
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
# This works as of Mongoid v3 | |
Model.collection.database.command(geoNear: "models", near: [50, 50]) |
OlderNewer