Skip to content

Instantly share code, notes, and snippets.

View akagomez's full-sized avatar

Chris Gomez akagomez

View GitHub Profile
@akagomez
akagomez / random-todo.js
Last active May 7, 2019 13:42
Random todo generator
(function () {
var actions = 'call,read,dress,buy,ring,hop,skip,jump,look,rob,find,fly,go,ask,raise,search';
var bridges = 'the,a,an,my,as,by,to,in,on,with';
var targets = 'dog,doctor,store,dance,jig,friend,enemy,business,bull,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday,Mom,Dad';
var capitalizeFirstLetter = function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
var randomWord = function (list) {
list = list.split(',');
@akagomez
akagomez / index.html
Created March 17, 2015 18:35
Clickable tiles in node-webkit
<html>
<head>
<style type="text/css">
body { margin: 0; padding: 0; }
div { float: left; background: #f00; }
</style>
</head>
<body>
<script type="text/javascript">
var gui = require('nw.gui');
var Example = Map.extend({ }, {
define: {
name: {
value: 'Nailed it'
}
}
});
var NestedMap = Map.extend({ }, {
define: {
@akagomez
akagomez / blockquote.txt
Last active August 29, 2015 13:57
Markdown blockquote
> It has to be easy to use. If it’s not easy to use, you will not use it.
> - [Ronald Walters](https://www.youtube.com/watch?v=dbirU_hqROY&feature=youtu.be&t=56s)
@akagomez
akagomez / blockquote.html
Last active August 29, 2015 13:57
HTML blockquote
<blockquote>
<p>
It has to be easy to use. If it’s not easy to use, you will not use it.
</p>
<a href="https://www.youtube.com/watch?v=dbirU_hqROY&feature=youtu.be&t=56s">
Ronald Walters
</a>
</blockquote>
@akagomez
akagomez / helpers.js
Created February 29, 2012 02:35
express-messages-bootstrap2
messages: function(req, res) {
var buf, i, j, len, messages, msg, msgs, type, types, _ref;
buf = [];
messages = req.flash();
types = Object.keys(messages);
len = types.length;
if (!len) {
return '';
}
buf.push('<div id="messages">');
@akagomez
akagomez / gist:1025933
Created June 14, 2011 21:26 — forked from hunterloftis/gist:1025903
Install Git, Node, NPM, Nginx, PHP (Fast CGI), CouchDB, and MySQL on Ubuntu 10.04 LTS
# This should be run on a new Linode Ubuntu 32-bit 10.04 image as root to prepare it for Nginx, PHP, MySQL, Node, CouchDB environment
# To start, something like this works:
# scp prepare_server.sh root@123.456.789.10:/root
# First, install basic linux utilities (compilers, git, libssl)
cd /root
mkdir /src
cd src
@akagomez
akagomez / jQuery Toggle ClassNames
Created April 7, 2011 15:41
3 contrasting ways to display 1 of many different classnames to denote element type. While HTML5 allows us to set what could be a type with data-* and assign it one of many values, IE6 and lower would still be unable to apply styles to that element. The
var statuses = ['drafted', 'on-the-clock'];
var self = this;
// Method 1: Lazy
$(this.el).removeClass(statuses.join(' '));
if (this.model.getStatus() == 'drafted') {
$(this.el).addClass('drafted');
}
if (this.model.getStatus() == 'on-the-clock') {
$(this.el).addClass('on-the-clock');