Skip to content

Instantly share code, notes, and snippets.

View justinpage's full-sized avatar

Justin Page justinpage

View GitHub Profile
" Prepare a new PHP class
function! s:Class()
let name = input('Class name: ')
let namespace = input('Any Namespace: ')
if strlen(namespace)
exec 'normal i<?php namespace ' . namespace . '; x27'
else
exec 'normal i<?php x27'
endif
// Make sure that your conditions inside your for loop are
// contained withing brackets
for (i = 1; i <= 25; i++) {
// what is your goal? Dividing by a boolean will not return
// desired results. In other words, (i == hfact) will return a truthy
// or falsy value
if ((hfact * i) / i == hfact)
{
hfact *= i;
<?php
echo "\nEnter an integer for its inverted complement: ";
/**
* Scan input from command-line, make sure the input has value,
* send input to accompanying function and output inverted compliment
*/
if ( 1 === fscanf(STDIN, '%d', $input)) {
$comp = getIntegerComplement($input);
<?php
/**
* The BinaryNode class defines a node object
*
* Provides value for current node, left child, and
* right child.
*/
class BinaryNode
{
public $value;
<?php
/**
* The BinaryNode class defines a node object
*
* Provides value for current node, left child, and
* right child.
*/
class BinaryNode
{
public $value;
<VirtualHost *:80>
ServerName laravel.dev
ServerAlias laravel.dev
<Directory /var/www/laravel.dev/laravel/public/>
Options FollowSymLinks Indexes MultiViews
AllowOverride All
Require all granted
</Directory>
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
var fs = require("fs");
var config = JSON.parse(fs.readFileSync("config.json"));
var host = config.host;
var port = config.port;
var express = require("express");
var mongo = require("mongodb");
var dbHost = "127.0.0.1";
var dbPort = mongo.Connection.DEFAULT_PORT;
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
livereload = require('gulp-livereload');
gulp.task('lint', function() {
gulp.src('./js/*')
.pipe(jshint())
.pipe(jshint.reporter('default'))
@import 'compass/reset';
$bg: #bb574e;
$nav: #ffffff;
$cont: #000000;
$navTop: 20px;
body {
width: 800px; margin: 0 auto; font-family: Helvetica; margin-top: 4em;
font-size: 1em / 1.5em; /** 16px **/; color: $nav; border: 1px solid darkgrey;