From | To | Python |
---|
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 FailClassInference | |
def fail(*args) | |
return super unless args.first.is_a?(String) | |
super(infer_exception_class, *args) | |
end | |
def raise(*args) | |
return super unless args.first.is_a?(String) | |
super(infer_exception_class, *args) |
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
[ [ { title: 'A Camp with No Name (ACWNN)', | |
description: 'The dead horse is scarce, and we continue to beat it. Come by and sit in the desert in A Camp With No Name, where you will be told that buttered popcorn is a perfectly fantastic snow cone flavor – why would you think otherwise? (Don’t worry – there are “normal” flavors.) Look for us carting around chai or tidying up the playa with our vacuum cleaner.', | |
Hometown: 'Denver', | |
URL: 'https://www.facebook.com/pages/A-Camp-with-No-Name/259880375086?ref=hl' }, | |
{ title: 'A Cosmic Carnivale', | |
description: 'Come and visit a Cosmic Carnival and may your body never miss a beat to the rhythm of this world.', | |
Hometown: 'Reno', | |
Contact: '[email protected]' }, | |
{ title: 'A Shack of Sit', | |
description: 'SIT HAPPENS HERE 24×7. Shady chairs & lounges: refresh, rest, meet Burners. Enjoy iced water, healthy snax, lots of activities & WiFi.', |
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
# Share constants between ruby and javascript | |
# Setup | |
# (in application.html.erb, or some place to inject javascript) | |
# MyApplication.constants = #{CommonConstants.to_json}; | |
# | |
# Usage | |
# Ruby | |
# CommonConstants << "Math::PI" | |
# Javascript | |
# MyApplication.constants.MATH_PI |
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
@import "bourbon"; | |
@import "neat"; | |
@import "mixins"; | |
html, body { | |
font-family: $font-proxima-nova; | |
font-size: $fs-root; | |
} | |
input, select, textarea { |
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
Article.prototype.comments = function() { | |
var url = RouteIndex.comments($scope.article.id).relative(); | |
var deferred = $q.defer(); | |
$http.get(url).success(function(comments) { | |
deferred.resolve(comments); | |
}); | |
return deferred.promise; | |
}; | |
//usage |
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
'use strict'; | |
angular.module('rallyApp') | |
.service('EventQueue', function EventQueue($q) { | |
var eventQueues = {}; | |
var listeners = {}; | |
var triggerEvent = function(queue, event, listener) { | |
queue.splice(queue.indexOf(event), 1); | |
listener.cb(event); |
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
(ns shorty-clojure.handler | |
(:use compojure.core) | |
(:use ring.util.response) | |
(:require [compojure.handler :as handler] | |
[compojure.route :as route] | |
[ring.util.response :as resp] | |
[ring.middleware.json :as middleware] | |
[taoensso.carmine :as car :refer (wcar)])) | |
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
it "does not have any symbols" do | |
perform_source = described_class.method(:perform).source | |
tokens = Ripper.lex(perform_source).map {|token| SyntaxToken.new(token) } | |
potential_symbols = ObjectRegex.new('symbeg (ident | kw)').all_matches(tokens) | |
if potential_symbols.any? | |
potential_symbols.flatten.each do |token| | |
next unless token.type == :on_symbeg | |
source_line = perform_source.lines.to_a[token.line - 1] | |
warn "Potential symbol found on column #{token.col} of #{described_class}#perform" | |
warn source_line |
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
data:text/html, <html><style>* { color: #f00 }</style><body>meow<a href="data:text/html, <html><style> * { color: #00f}</style><body>bark<a href='javascript:window.history.go(-1)'>go</a></body></html>">go</a></body></html> |