Skip to content

Instantly share code, notes, and snippets.

@webdesserts
webdesserts / Gulpfile.js
Last active April 3, 2023 08:16
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.

Keybase proof

I hereby claim:

  • I am webdesserts on github.
  • I am webdesserts (https://keybase.io/webdesserts) on keybase.
  • I have a public key whose fingerprint is EFEF AB55 BA03 4063 BB37 6F25 BD9D 259B A9DF DEE0

To claim this, I am signing this object:

@webdesserts
webdesserts / file1.css
Last active April 12, 2016 20:55
nesting classes from external css-modules
.code-block {
/* My special code block. Covers 90% of all use cases. */
}
@webdesserts
webdesserts / testing_element_existence.js
Last active December 31, 2015 04:29
Testing for the presence of an item in an array with `.indexOf()` and the `~` bitwise operator
var desserts = ['gelato', 'tiramisu', 'double chocolate volcano cake']
// indexOf() is a nifty little Array method that returns the index of the element passed
desserts.indexOf('gelato') //=> 0
// One oditty of it is that it returns -1 if there is no match.
desserts.indexOf('meatloaf') //=> -1
// So the question arrises, "why -1"?
@webdesserts
webdesserts / hand_written.svg
Created December 7, 2013 21:06
Hand written SVG by Sven_vB Original link here: http://paste.ohai.su/ptmswxggy/2iymbd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@webdesserts
webdesserts / Readme.md
Last active December 27, 2015 10:39
A quick overview of how the webdesserts.com website will be built

webdesserts.com

Development

  1. Content - first, we have to have a reason to have a website. In all honesty the main purpose of this website is to host an online resume and show off my design abilities. But in reality that's a poor purpose for a site. I need content. Real content. So if I'm going to have to start a blog, let's at least make it useful to people other than me. I will write all my content first before I write a single line of code.
  2. Design - I will need mockups. Initially, this should probably be done in Photoshop. If I feel like going the extra step, I might finish the design in Adobe Reflow, just to get a feel for how the website might act. However, this site is probably small enough that I can just start prototyping in the browser.
  3. Frontend - After the design phase, I will write a static version of the frontend. Everything will be hardcoded. Nothing will be dynamic. This is just for working out the css and transitioning the site from it's wire
@webdesserts
webdesserts / line-splitter.js
Last active December 15, 2015 18:19 — forked from deoxxa/line-splitter.js
Creates a transform stream that splits any stream pipped into it into lines.
var stream = require("stream"),
util = require("util");
var LineSplitter = function LineSplitter(options) {
options = options || {};
options.objectMode = true;
stream.Transform.call(this, options);
this.buffer = "";
};
util.inherits(LineSplitter, stream.Transform);
@webdesserts
webdesserts / JS_Intro.md
Last active December 15, 2015 16:59
This is an ongoing attempt to build an introductory slideshow to JavaScript for those I meet who are new to the language.

What is JavaScript?

##What is JavaScript? Created by Brendan Eich in 1995 for the Netscape browser

###Features

  • functional
  • object oriented
  • asyncronous
  • event-based
@webdesserts
webdesserts / sidebar.md
Last active December 13, 2015 20:18
Side Bar Observations for SublimeText3

#ST3 Side Bar

##Commands

  • reveal_in_side_bar
    • opens sidebar if it is hidden
    • highlights currently selected file (and opens it's containing folders)
  • focus_side_bar
    • ctrl+0
  • moves "cursor" to side bar
{
"name": "web-app",
"scripts": {
"build": "gulp build",
"start": "gulp serve",
"test": "gulp test"
},
"devDependencies": {
"gulp": "~3"
}