Skip to content

Instantly share code, notes, and snippets.


Darryl Dexter DarrylD

Block or report user

Report or block DarrylD

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
DarrylD / zen.1h.js
Created Nov 6, 2017
Bitbar plugin to give zen like quotes
View zen.1h.js
var quotes = [
"Whatever you are, be a good one.\n-Abraham Lincoln",
"If you dream it, you can do it.\n-Walt Disney",
"Never, never, never give up.\n-Winston Churchill",
"Don’t wait. The time will never be just right.\n-Napoleon Hill",
"If not us, who? If not now, when?\n-John F. Kennedy",
"Everything you can imagine is real.\n-Pablo Picasso",
"I can, therefore I am.\n-Simone Weil",
DarrylD / ChatScroller.js
Created Sep 8, 2016
A chat scroller for react
View ChatScroller.js
import React from 'react'
<ChatScroller ref="chatScroller">
to force move the containt to the bottom:
DarrylD / directive.js
Created Feb 14, 2015
ionic slide box dynamic height - fixes the issue where the slide boxes aren't taking up the full height of the device
View directive.js
app.directive('dynamicHeight', function() {
return {
require: ['^ionSlideBox'],
link: function(scope, elem, attrs, slider) {
scope.$watch(function() {
return slider[0].__slider.selected();
}, function(val) {
//getting the heigh of the container that has the height of the viewport
var newHeight = window.getComputedStyle(elem.parent()[0], null).getPropertyValue("height");
if (newHeight) {
DarrylD / app.js
Created May 2, 2014
express.js, simple dynamic route loading
View app.js
//all of your express config stuff
var express = require('express')
, app = express()
//load api routes (app of the files from /api)
//rest of your expressjs stuff
DarrylD / view-constructor-override.js
Last active Aug 29, 2015
Simple override of a Backbone class, View in this case. Can be applied to modal, collection, etc...
View view-constructor-override.js
Backbone.View = (function(View) {
// Define the new constructor
Backbone.View = function(attributes, options) {
// New constructor stuff here...
// Call default constructor
View.apply(this, arguments);
DarrylD / koa-example.js
Last active Jan 3, 2016
Made a lengthier example on Koa's flow and how it uses generators. This is just demonstrating how the middleware stacks and uses yield opposed to using callbacks like in ExpressJS.
View koa-example.js
//Koajs example
var koa = require('koa');
var app = koa();
//Middleware cascading
app.use(function * (next) {
//Some stuff will happen here first
console.log('FIRST execution')
DarrylD / paste-image.html
Created Nov 7, 2013
Demo of simple way to paste ( ctrl+v ) from clipboard.
View paste-image.html
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>Paste image from clipboard in Chrome</title>
<script src=""></script>
//plugin for pasting from
(function($) {
// plugin by STRd6
DarrylD / stickyheader.js
Last active Dec 27, 2015
Simple fixed header after trigger point
View stickyheader.js
var triggerElement = $(".container") //element to he used to trigger the fixed header
, header = $(".header") //element of header
, stickyClass = "stickit" // class to be used to give the fixed header a fixed position
var offset = 0,sticky = false,top = $(window).scrollTop();
if (triggerElement.offset().top < top) {
sticky = true;
You can’t perform that action at this time.