Skip to content

Instantly share code, notes, and snippets.

View djfarrelly's full-sized avatar
🌞

Dan Farrelly djfarrelly

🌞
View GitHub Profile
@djfarrelly
djfarrelly / .hyperterm.js
Last active September 19, 2016 20:58
Personal HyperTerm perfs
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: '"Droid Sans Mono For Powerline", "Roboto Mono", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color (hex)
// cursorColor: '#F81CE5',
FROM alpine:3.3
ADD logger.sh /logger.sh
RUN chmod +x /logger.sh
CMD /bin/sh -c "/logger.sh"
@djfarrelly
djfarrelly / next.js
Created October 22, 2015 14:48
ES2015 intro chat
'use strict';
// What is ES2015?
// !!!!!!!!!!!!!! let, const !!!!!!!!!!!!!!!!!!!!!!
const ONE_HOUR = 60 * 60 * 1000;
ONE_HOUR = 60 * 60;
// Throws error
@djfarrelly
djfarrelly / Button.jsx
Last active August 28, 2015 18:22
style-guide
import classNames from 'classnames';
import getValidProps from '../lib/utils';
class Button extends React.Component {
render () {
var classes = classNames('Button', {
'Button--large': this.props.size === 'large',
'Button--small': this.props.size === 'small',
'Button--primary':this.props.primary,
'Button--hollow': this.props.hollow
@djfarrelly
djfarrelly / analyticsStore.js
Last active August 29, 2015 14:21
In an effort to more intelligently request data for sent updates
var AnalyticsStore = modules.exports = {
_data: new Backbone.Collection(),
_daysInCache: [],
grabDaysForCache: function(data) {
var days = data.updates.map(function(update){
return Math.r(update.due_at / 24 / 3600); // days since 1970
});
@djfarrelly
djfarrelly / QueueController.js
Created May 11, 2015 19:36
QueueController idea
/* globals React */
var Timeline = require('../shared/views/timelineReact.js');
var QueueHeader = require('../shared/views/queueHeader.js');
// buffer.View.CalendarPending
var QueueController = module.exports = {
_data: {
view: 'list'
},
@djfarrelly
djfarrelly / ReactModal.jsx
Last active August 29, 2015 14:13
React modal for buffer
/* globals React */
/** @jsx React.DOM */
/**
* ReactModal
* Create your own React modal within a react component:
* render: function() {
* return (
* <ReactModal isOpen={this.props.isOpen}>
* <ReactModalHeader>
@djfarrelly
djfarrelly / localDatabase.js
Last active August 29, 2015 14:06
db.js last modified
// deps:
// db.js = shared/libs/db.js
buffer.localDatabase = {
// Increase this to clear the db entirely
dbVersion: 1,
open: function() {
return db.open({
@djfarrelly
djfarrelly / index.js
Created August 12, 2014 22:37
requirebin sketch
var Levenshtein = require('levenshtein');
var titles = ["15 Twitter Hacks That Will Turn You Into a Twitter Ninja", "The Big List of Twitter Tools: 59 Free Twitter Tools and Apps to Fit Any Need", "Introducing Groups: The Easiest Way to Manage All Your Social Media Accounts With One Click", "What Really Happens When Someone Clicks Your Facebook Like Button"];
var currentTitle = "59 Free Twitter Tools and Apps That Do Pretty Much Everything";
function matchingWordsPercentage(orig, test) {
var origWords = orig.toLowerCase().split(' ');
var testWords = test.toLowerCase().split(' ');
@djfarrelly
djfarrelly / placeholder-polyfill.js
Created July 10, 2014 23:08
jQuery placeholder polyfill using Modernizr
;(function($){
function inputFocus(){
var input = $(this);
if (input.val() === input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}