This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forceGraph(opts) { | |
opts = opts || {}; | |
opts.node = opts.node || {}; | |
opts.link = opts.link || {}; | |
var | |
Self = this, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tree = { | |
name: "Tree", | |
children: [ | |
{ | |
name: "1", | |
children:[ | |
{ | |
name: "1.1" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cluster = require('cluster') | |
//Console Styling | |
, Colors = require('colors') | |
//Total number of CPUs | |
, CPU_Count = require('os').cpus().length | |
//Timeouts for handling erroneous child-process spawning | |
, TimeOuts = [] | |
//Number of worker processes | |
, WorkerC = 0 | |
//Log errors (an alert/logging mechanism belongs here) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thumbnailer = -> | |
Thumbnailer = this | |
fs = require "fs" | |
cp = require "child_process" | |
path = require "path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(! defined("BASEPATH")) exit("No direct script access allowed"); | |
abstract class MY_Model extends CI_Model { | |
private $file_dest; | |
private $table; | |
private $fields; | |
private $field_values; | |
public function __construct() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//index.js | |
var express = require('express'), | |
app = module.exports = express.createServer(), | |
mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/nodeAuth'); | |
//configure app | |
app.configure(function() { | |
app.set('views', __dirname + '/views'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//AppException.php | |
class AppException extends Exception { | |
public function __construct($msg="", $code = 0) { | |
/* | |
PHP's Exception class will handle all | |
of the necessary validation | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connect = mysql_connect(DB_HOST, DB_USER, DB_PASS) | |
or die(mysql_error()); | |
mysql_select_db(DB); | |
//SQL | |
$sql = "SHOW COLUMNS FROM TABLENAME"; | |
//Query | |
$query = mysql_query($sql) | |
or die(mysql_query()); | |
//results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//App class | |
class App { | |
//Holds Singleton instance | |
public static $instance; | |
//environment vars | |
public static $vars = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Directory Structure | |
/app | |
/scripts | |
|-handleFormSubmit.js | |
/node_modules | |
/views | |
|-index.jade | |
/controllers | |
|-maps_controller.js |