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 is wrapped in an `async` function | |
// you can use await throughout the function | |
const OBJECT_NEWLINE_DELIMETER = "\n\n"; | |
const FIELD_NEWLINE_DELIMETER = "\n"; | |
const KEY_DELIMETER = ": "; | |
const COMPLEX_VALUE_FIELD_TYPES = ["tin"]; | |
const extractComplexValue = (data) => { | |
const stringObj = data.value.replace(/ /g, "").replace(/'/g, '"'); | |
try { |
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
// Package.json | |
"handlebars-loader": "^1.4.0" | |
// /.env | |
GOOGLE_MAPS_KEY=YOUR_KEY | |
// ENV VAR SETUP - config/index.js | |
// *** load the config vars from .env using 'dotenv' *** | |
const dotenv = require('dotenv') | |
dotenv.config() |
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
/* | |
Tcomb-Form | |
*/ | |
import t from 'tcomb-form-native'; | |
const Form = t.form.Form | |
var Contact = t.struct({ | |
name: t.Str, | |
photo_url: t.Str | |
}); | |
const Profile = t.struct({ |
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>Blah</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
********* permission_spec.rb ********* | |
require "spec_helper" | |
RSpec::Matchers.define :allow do |*args| | |
match do |permission| | |
permission.allow?(*args).should be_true | |
end | |
end | |
describe Permission, focus: true 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
_ = require('./underscore'); | |
Robot = function () { | |
var directions = { | |
north: [0, 1], | |
east: [1, 0], | |
south: [0, -1], | |
west: [-1, 0] | |
} |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
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 id="maincontainer"> | |
<div id="topsection"> | |
<div class="innertube"> | |
<div id="logo"> | |
<h1>Tuneline</h1> | |
</div> | |
<div id="login"> | |
<% if current_user %> | |
Signed in as <%= current_user.name %>! | |
<%= link_to "Go to my page", root_url(subdomain: current_user.subdomain) %> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'> | |
<title>FeedEngine</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= javascript_include_tag "soundcloud" %> | |
<%= csrf_meta_tags %> | |
</head> |
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 MegaNums | |
def initialize(number) | |
@number = number | |
end | |
def say_num | |
word_nums = "" | |
if @number > 999_999 |