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
var d = new Date(); | |
var tz_offset = d.getTimezoneOffset(); // seconds, not ms, because Javascript | |
var tz_select = $('#tz-select'); | |
var abbr = tz_select.find("option[data-offset='" + tz_offset + "']").data('abbreviation'); |
This file has been truncated, but you can view the full 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
Fetching repository, done. | |
-----> Node.js app detected | |
PRO TIP: Specify a node version in package.json | |
See https://devcenter.heroku.com/articles/nodejs-support | |
-----> Defaulting to latest stable node: 0.10.31 | |
-----> Downloading and installing node | |
-----> Exporting config vars to environment |
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 | |
site 'http://community.opscode.com/api/v1' | |
cookbook 'sprout-rbenv', | |
:github => 'pivotal-sprout/sprout-rbenv' | |
cookbook 'sprout-ruby', | |
:github => 'pivotal-sprout/sprout-ruby' |
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 MyController < ApplicationController | |
def create | |
@model = Model.new(model_params) | |
# we have to call this here, to populate | |
# errors on any other fields that might | |
# be invalid | |
@model.valid? | |
if @model.model_attr == 'invalid' && !@model.in_state(:dont_care) |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
^([^:]+:\/\/)([^@]+\@)?([^:\/]+)(:\d+)?(\/[^\s\?\#]+)+(\?([^\n\#]+)(\#\S+)?|(\#\S+))?$ |
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 Hash | |
# gets hash-nested values, returns nil if any key is missing | |
def dig(*path) | |
path.inject(self) do |location, key| | |
location.respond_to?(:keys) ? location[key] : nil | |
end | |
end | |
# Deletes key from self and returns self | |
def kill(key) |
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
// A bunch of functions you can use in the MongoDB shell | |
// taken from http://api.mongodb.org/js/1.8.2/index.html | |
// amongst other sources | |
// Used in place of print() to view the contents of objects | |
printjson(x); | |
printjsononeline(x); | |
// File system interaction | |
ls(...); |
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 | |
# Script to quickly generate a new post for Jekyll | |
# 2012 Andrew Evans - http://atevans.com | |
require "net/http" | |
require "uri" | |
require 'RMagick' | |
def titleize(str) |
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
<Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none"><Code><Value>Receiver</Valu... xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalSer... xml:lang="en-US">The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</Text></Reason></Fault> |
OlderNewer