Skip to content

Instantly share code, notes, and snippets.

View phoenixbox's full-sized avatar
💭
banging head against computer

Shane Rogers phoenixbox

💭
banging head against computer
View GitHub Profile
@phoenixbox
phoenixbox / gist:5165108
Created March 14, 2013 20:49
Say MegaNums
class MegaNums
def initialize(number)
@number = number
end
def say_num
word_nums = ""
if @number > 999_999
<!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>
@phoenixbox
phoenixbox / gist:5572809
Created May 14, 2013 00:57
user_show_html_wireframe
<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) %>
@phoenixbox
phoenixbox / nginx
Created July 2, 2013 19:34
Nginx config file
#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;
@phoenixbox
phoenixbox / gist:5986890
Created July 12, 2013 19:03
JS solution to part of robot
_ = require('./underscore');
Robot = function () {
var directions = {
north: [0, 1],
east: [1, 0],
south: [0, -1],
west: [-1, 0]
}
@phoenixbox
phoenixbox / permission_rspec_errors
Created August 14, 2013 12:32
Rspec matcher error, allow matcher wont accept two parameters
********* 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
@phoenixbox
phoenixbox / sprintly
Created February 19, 2014 00:15
Sprintly
<div>Blah</div>
/*
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({
@phoenixbox
phoenixbox / webpack_handlebars_config
Created November 10, 2016 02:34
Webpack Handlebars Config
// 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()
@phoenixbox
phoenixbox / processFormData.js
Last active November 19, 2021 17:55
PriceBlocs - Zapier Run JS - Process form data
// 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 {