View TypeScriptAssetWithErrors.ts
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
const Asset = require('parcel/src/Asset'); | |
const chalk = require('chalk') | |
const ts = require('typescript') | |
const path = require('path'); | |
const localRequire = require('parcel/src/utils/localRequire') | |
class TypeScriptAssetWithError extends Asset { | |
constructor(name, options) { | |
super(name, options); | |
this.type = 'js'; |
View index.js
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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
alert('hello'); |
View change_maker.rb
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
# Not thoroughly tested, but this seems to solve the problem recursively | |
class ChangeMaker | |
# in cents, so the below ints are equal to | |
# penny, nickle, dime, quarter, dollar, five, ten, twenty, fifty, a hundred | |
DENOMINATIONS = [1, 5, 10, 25, 100, 500, 1000, 2000, 5000, 10000] | |
def initialize(cost, tendered) |
View gist:67e776a5ab9a7062b777
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
# refactoring of Kam Low's ::find_for_oauth | |
# Thanks so much for this article about managing multiple providers with omniauth | |
# Check it out: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ | |
def self.find_for_oauth(auth, signed_in_resource = nil) | |
identity = Identity.find_for_oauth(auth) | |
user = signed_in_resource ? signed_in_resource : identity.user | |
user = find_for_oauth_email(auth) || create_for_oauth(auth) if user.nil? | |
update_identity(identity, user) | |
user |
View gist:84cba7b845c8e7dd6b54
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 | |
/* | |
* | |
* link_to(url, text, options) | |
* url and text are strings, options is an object with any additional attributes you might want on a link | |
* Simple. Rustic, yeah? | Use it like this: | |
* link_to('http://www.google.com', "Google", object ["id" => "user_link_132930482", "class" => "my_link", "alt" => "alt-text"]); | |
* | |
*/ |