Skip to content

Instantly share code, notes, and snippets.

View scottoffen's full-sized avatar
💭
Live in SLC

Scott Offen scottoffen

💭
Live in SLC
View GitHub Profile
@scottoffen
scottoffen / plugin-template.js
Last active August 29, 2015 14:10
A jQuery Plugin Template
(function ($, undef)
{
// Function and variables defined in here that do not get
// attached to $ will be scoped to this function, effectively
// making them private.
$fn.plugin = function (options)
{
options = $.extend($.plugin.options, options);
@scottoffen
scottoffen / VirtualHost.md
Last active August 29, 2015 14:10
Modifying VirtualHost using EasyApache

WHMs EasyApache

Solution Used

Custom Directives Outside of a VirtualHost Tag

I created a copy of vhost.default at /var/cpanel/templates/apache2 named vhost.local, found the first line listed below and added the second line below it.

@scottoffen
scottoffen / apidocs.pl
Created February 4, 2015 15:49
Perl Swagger Resource Listing Generator
#!C:\lang\perl\bin\perl.exe
#!/usr/bin/perl -T
use strict;
use warnings;
use Fcntl qw(:flock);
use Try::Tiny;
use Cwd;
use JSON::PP;
@scottoffen
scottoffen / Example-User.pm
Created February 5, 2015 18:20
Example Perl module for a User table using Metaphor
package Example::User;
our $VERSION = '1.0.0';
#########################################||#########################################
# #
# Example::User #
# © Copyright Information and Link To Authors Site Goes Here #
# #
#########################################||#########################################
@scottoffen
scottoffen / map-world.pl
Last active August 29, 2015 14:18
Use Perl to create an AutoHotKey (ahk) macro that will run and build out your Minecraft world map
#!c:\lang\perl\bin\perl.exe
use strict;
use warnings;
use Fcntl qw(:DEFAULT :flock);
# How high you want to be teleported
my $y = 200;
# The x offset for the center of the map
my $offx = 1000;

My pi runs a raspbian distro (2013-09-25-wheezy-raspbian.zip)

Java

What the raspberry page officially recommends is the jdk. (Source: http://www.raspberrypi.org/archives/4920).

sudo apt-get update && sudo apt-get install oracle-java7-jdk

However, this doesn't include a server on the pi. The jre needs to be installed instead.

@scottoffen
scottoffen / mongodb-service.bat
Last active March 4, 2016 08:12
MongoDB Windows Service Setup
@echo off
if %1.==. goto UseDefaults
set srvname=%1
if %2.==. goto UseDefaultApp
set app=%2
if %3.==. goto UseDefaultConfig
set config=%3
@scottoffen
scottoffen / node-file-uploads.md
Created July 23, 2015 19:52
Node.js File Uploads

On the frontend, use dropzone.js, on the backend, use connect-express.

Node Route Example

module.exports.post = function (req, res, next)
{
	console.log('request:');

	var fstream;
	req.pipe(req.busboy);
@scottoffen
scottoffen / neo4j.md
Last active August 29, 2015 14:26
Neo4j Resource

Utilities

  • Structr : Not yet sure what exactly this does.

node/npm

  • Seraph (npm) : A terse & familiar binding to the Neo4j REST API that is idiomatic to node.js
  • Seraph-Model (npm) : provides some convenient functions for storing and retrieving typed nodes from a neo4j database using seraph
  • Seraph-Resource : creates a controller with crud methods for a seraph model.