Skip to content

Instantly share code, notes, and snippets.

Brian Takita btakita

Block or report user

Report or block btakita

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@btakita
btakita / Index.html
Last active Aug 27, 2017
Svelte Isomorphic Components with Hydration (http://www.briantakita.com/posts/sveltejs-from-pug/)
View Index.html
<!-- Index.html is used in DOM & SSR -->
<Layout id="index" class__root="Index" ctx="{{ctx}}">
<main>
<article ref:presentation id="presentation">
<section class="slide-0">
Slide 0
</section>
<section class="slide-1">
Slide 1
</section>
@btakita
btakita / us-locations.json
Last active Jun 7, 2016
Used by suppressthis.org - DO NOT REMOVE
View us-locations.json
[{"zipcode":"10001","state_abbr":"NY","latitude":"40.750742","longitude":"-73.99653","city":"New York","state":"New York"},{"zipcode":"10002","state_abbr":"NY","latitude":"40.717040","longitude":"-73.98700","city":"New York","state":"New York"},{"zipcode":"10003","state_abbr":"NY","latitude":"40.732509","longitude":"-73.98935","city":"New York","state":"New York"},{"zipcode":"10004","state_abbr":"NJ","latitude":"40.699226","longitude":"-74.04118","city":"New York","state":"New Jersey"},{"zipcode":"10005","state_abbr":"NY","latitude":"40.706019","longitude":"-74.00858","city":"New York","state":"New York"},{"zipcode":"10006","state_abbr":"NY","latitude":"40.707904","longitude":"-74.01342","city":"New York","state":"New York"},{"zipcode":"10007","state_abbr":"NY","latitude":"40.714754","longitude":"-74.00721","city":"New York","state":"New York"},{"zipcode":"10009","state_abbr":"NY","latitude":"40.727093","longitude":"-73.97864","city":"New York","state":"New York"},{"zipcode":"10010","state_abbr":"NY","latitud
@btakita
btakita / prototypeSmash.js
Created Feb 8, 2016
prototypeSmash - assign Object.getPrototypeOf(obj), obj
View prototypeSmash.js
export default function prototypeSmash(obj) {
return Object.assign.apply(Object, [{}].concat(Object.getPrototypeOf(obj), obj));
}
@btakita
btakita / bundle.build.js
Last active Jan 11, 2016
browserify,babelify,riotify,uglify,gzip-size build script
View bundle.build.js
#!/usr/bin/env babel-node
var fs = require('fs')
, path = require('path')
, browserify = require('browserify')
, babelify = require('babelify')
, riotify = require('riotify')
, uglify = require('uglify-js2')
, watchify = require('watchify')
, gzipSize = require('gzip-size')
, source = require('vinyl-source-stream')
View vim-on-heroku.sh
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
View attributes
echo
null
id
25818655
import_id
25818655
@btakita
btakita / jasmine-node-overrides.js
Last active Sep 7, 2019
Fix for it & Fast failure output for jasmine-node.
View jasmine-node-overrides.js
function fixIt() {
GLOBAL.it = function() {
return jasmine.getEnv().it.apply(jasmine.getEnv(), arguments);
}
}
function immediateErrorOutput() {
var theOriginalFail = jasmine.Spec.prototype.fail;
jasmine.Spec.prototype.fail = function (e) {
theOriginalFail.apply(this, arguments);
@btakita
btakita / foo_spec.js
Created May 27, 2012
Monkey-patch to add prototypes in describes to allow helper method overriding and mixins in specs
View foo_spec.js
var MyMixin = {
bar: function() {
return "MyMixin bar";
}
};
describe("First Level", function() {
var variableFn = function() {
return "First Level variableFn";
};
View thrift_spec.rb
describe UserService do
attr_reader :client_iprot, :client_iprot_transport, :client_oprot, :client_oprot_transport, :server_iprot, :server_iprot_transport, :server_oprot, :server_oprot_transport, :client, :server_handler, :server_processor
before do
@client_iprot_transport = ::Thrift::MemoryBufferTransport.new
@client_iprot = ::Thrift::BinaryProtocol.new(client_iprot_transport)
@client_oprot_transport = ::Thrift::MemoryBufferTransport.new
@client_oprot = ::Thrift::BinaryProtocol.new(client_iprot_transport)
@client = UserService::Client.new(client_iprot, client_oprot)
@server_iprot_transport = ::Thrift::MemoryBufferTransport.new
@btakita
btakita / tc-user.thrift
Created May 18, 2011
user service architecture meeting
View tc-user.thrift
namespace rb TcUser.Thrift
namespace py userservice
exception UserGetError {
1: string reason
}
exception UserCreateError {
1: map<string,list<string>> errors
}
You can’t perform that action at this time.