Skip to content

Instantly share code, notes, and snippets.

View chrisjlee's full-sized avatar
💭
🏈

Chris J. Lee chrisjlee

💭
🏈
View GitHub Profile
@chrisjlee
chrisjlee / wp.sh
Created August 6, 2012 21:24 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script
#!/bin/bash
echo “Database Name: ”
read -e dbname
echo “Database User: ”
read -e dbuser
echo “Database Password: ”
read -s dbpass
echo “run install? (y/n)”
read -e run
if [ "$run" == n ] ; then
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@chrisjlee
chrisjlee / async-await.js
Created December 15, 2017 02:04 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@chrisjlee
chrisjlee / async-await.js
Created December 15, 2017 02:04 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@chrisjlee
chrisjlee / phprc
Created August 7, 2016 05:46 — forked from amnuts/phprc
Dreamhost PHP 5.6 phprc file
date.timezone = "Europe/London"
expose_php = 0
extension = phar.so
extension = fileinfo.so
extension = intl.so
suhosin.executor.include.whitelist = phar
[opcache]
zend_extension=opcache.so
// Define gulp before we start
var gulp = require('gulp');
// Define Sass and the autoprefixer
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
// This is an object which defines paths for the styles.
// Can add paths for javascript or images for example
// The folder, files to look for and destination are all required for sass
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);

Getting Started with YUI

Welcome to the YUI library! This tutorial contains everything you need to get up and running quickly with YUI. If you've never used YUI before, but you perhaps have a little experience with plain JavaScript or JavaScript frameworks, read onward.

Note that if you have experience with jQuery, it is a great idea to read or at least skim through the JS Rosetta Stone, which demonstrates how common jQuery and YUI idioms map to each other. The good news is that in the areas where YUI and jQuery overlap, you'll find that it is not too difficult to translate back and forth between the two.

Loading SimpleYUI

The easiest way to get started with YUI is to use SimpleYUI, a convenient package for working with DOM nodes, events, UI effects, and AJAX.

@chrisjlee
chrisjlee / Gruntfile.js
Created November 21, 2013 16:13 — forked from aschmoe/Gruntfile.js
This particular gruntfile actually is the runner to generate Drupal Subthemes.
'use strict';
var path = require('path');
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
copy: {
main: {
files: [
{
#!/bin/bash
DIR=/var/www/YOUR_APP_NAME
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NODE_PATH=/usr/local/lib/node_modules
case $1 in
start)
nohup "node" "$DIR/proxy.js" 1>>"$DIR/logs/proxy.log" 2>&1 &
echo $! > "$DIR/pids/proxy.pid";
;;