Skip to content

Instantly share code, notes, and snippets.

View jtremback's full-sized avatar

Jehan jtremback

  • Bay Area
View GitHub Profile
@jtremback
jtremback / total_css_reset.css
Created February 10, 2014 05:44
Total CSS reset. Puts all properties back to their defaults from https://developer.mozilla.org/en-US/docs/Web/CSS. Good for bookmarklets and extensions, or if you just don't want to deal with any nonsense.
* {
align-content: stretch;
align-items: stretch;
align-self: auto;
animation-delay: 0s;
animation-direction: normal;
animation-duration: 0s;
animation-fill-mode: none;
animation-iteration-count: 1;
animation-name: none;
@jtremback
jtremback / gist:9404530
Created March 7, 2014 02:59
single-step tip resolve
resolve: function (account, callback) {
if (this.state !== 'created') return callback(new Error('Tip cannot be claimed')); // Sorry, all done
if (account._id !== this.from_wallet || account._id !== this.to_wallet) {
return callback(new Error('Wrong wallet')); // Wrong wallet
}
this.state = 'resolving';
this.resolved_id = new ObjectID(); // resolved_id identifies the tip later
this.save(function (err, tip) {
'use strict';
/*global $, main_html, style_css, toolbar_html*/
console.log('hello.')
var style_css = '.dgw-dogewand *{-webkit-align-content:stretch;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-align-self:auto;-ms-flex-item-align:auto;align-self:auto;-webkit-animation-delay:0s;animation-delay:0s;-webkit-animation-direction:normal;animation-direction:normal;-webkit-animation-duration:0s;animation-duration:0s;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-name:none;animation-name:none;-webkit-animation-play-state:running;animation-play-state:running;-webkit-animation-timing-function:ease;animation-timing-function:ease;-webkit-backface-visibility:visible;-ms-backface-visibility:visible;backface-visibility:visible;background-attachment:scroll;background-clip:border-box;background-color:transparent;background-image
function _handleTouch() {
var self = this;
self.pageViewPos = new Transitionable(0);
self.sync = new GenericSync(function() {
return self.pageViewPos.get(0);
}, {direction: GenericSync.DIRECTION_X});
self.pageView.pipe(self.sync);
'use strict';
var mongoose = require('mongoose');
var Account = mongoose.model('Account');
var Tip = mongoose.model('Tip');
var models = {
Tip: Tip,
Account: Account
};
@jtremback
jtremback / My own Gmail
Created April 21, 2014 03:15
My own Gmail
function _B_log(imp, opt_val) {
var p = "imp\x3d" + imp;
if (arguments.length > 1)
p += "\x26val\x3d" + opt_val;
_B_logImg_("jsle", p)
}
var loadTimes = [GLOBALS[0], GLOBALS[1], JS_START_TIME];
var loadTimesMap = {"fjs": GLOBALS[0],"bjsi": GLOBALS[1],"sjsi": JS_START_TIME};
function _B_record(opt_Name, opt_onlyMap) {
var t = (new Date).getTime();
<div class="adv-common search-bar">
<input type="text" class="adv-common search" placeholder="Search"/>
</div>
@jtremback
jtremback / gist:1eaece0807fa3fe02262
Last active August 29, 2015 14:06
Meteor attempts
// 'use strict';
// An app that has items and stories.
// Items have properties: name, weight, description.
// Stories have properties: title, content, item
// Stories contain a widget for their item
// The add item screen shows this widget, live updating with a binding to the form.
// The same widget template code being used on both screens.
// Screens: story detail, add/edit story, add/edit item
var counterA = 0;
@jtremback
jtremback / gist:cfaa53aa0376032982af
Created October 26, 2014 01:25
Don't understand why this doesn't work
'use strict';
var pull = require('pull-stream')
var net = require('net')
var toStream = require('pull-stream-to-stream')
var rimraf = require('rimraf')
rimraf.sync('./following1.db') // delete the db from last time
var ssb1 = require('../create')('./following1.db')
var feed1 = ssb1.createFeed()
'use strict';
var pull = require('pull-stream')
var net = require('net')
var toStream = require('pull-stream-to-stream')
var rimraf = require('rimraf')
rimraf.sync('./following1.db') // delete the db from last time
var ssb1 = require('../create')('./following1.db')
var feed1 = ssb1.createFeed()