Skip to content

Instantly share code, notes, and snippets.

@lgoldstien
lgoldstien / 0_reuse_code.js
Created November 28, 2013 09:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lgoldstien
lgoldstien / Task.php
Created July 5, 2013 14:59
orno-json-task
<?php
namespace App\Controller;
use Orno\Mvc\View\JsonRenderer;
class Task
{
protected $view;
protected $taskid;
@lgoldstien
lgoldstien / kbms.user.js
Created July 4, 2013 13:59
phpKB - Copy text from articles
// ==UserScript==
// @name KBMS Script
// @description Copy text from articles!!!
// @author Lawrence Goldstien ( [email protected] )
// @icon http://csctools.internal.something.net/~lgoldstien/grease/img/kbms.png
// @namespace http://www.something.com
// @include http://kbms/*
// @include http://csctools.internal.something.net/~lgoldstien/beta/grease/tests/*
// @updateURL http://csctools.internal.something.net/~lgoldstien/grease/scripts/kbms.user.js
// @downloadURL http://csctools.internal.something.net/~lgoldstien/grease/scripts/kbms.user.js
<?php
/**
* Log
* A class for logging output to a file
*/
class Log {
public $app;
public $content;
<?php
/**
* Log
* A class for logging output to a file
*/
class Log {
/**
* @var string
*/
@lgoldstien
lgoldstien / stock_tickets.user.js
Created June 29, 2013 07:47
A greasemonkey script that is causing me problems
// ==UserScript==
// @name Give Me Tickets
// @description All the stock responses and stuff you could possibly need to get working on tickets
// @author Lawrence Goldstien ( lgoldstien@*******.co.uk )
// @namespace
// @include
// @grant none
// ==/UserScript==
console.log("Gimme Tickets: Starting to load the script");
@lgoldstien
lgoldstien / solid-s-SRP-task.php
Last active December 18, 2015 21:09
SOLID - S - SRP tasks class
<?php
/**
* Tasks - SRP
* A task database class that does abide by SRP
* @package solid
* @author [email protected]
*/
class db {
@lgoldstien
lgoldstien / solid-s-nonSRP-task.php
Last active December 18, 2015 21:09
SOLID - S - nonSRP tasks class
<?php
/**
* Tasks - Non-SRP
* A task database class that does not abide by SRP
* @package solid
* @author [email protected]
*/
class tasks {
@lgoldstien
lgoldstien / twitterstream.py
Created May 21, 2013 23:11
Twitter Stream (Python), use Twitter's status update sample stream to pull down a json formatted stream of status updates.
# Twitter Stream
# From "Introduction to Data Science" A coursera program with lectures from Bill Howe
# You will need to edit the access and consumer credentials to make this application work
# Run as follows: python twitterstream.py > output.json
import oauth2 as oauth
import urllib2 as urllib
access_token_key = "<Enter your access token key here>"
access_token_secret = "<Enter your access token secret here>"
@lgoldstien
lgoldstien / nginx.ssl.conf
Created January 4, 2013 10:54
Nginx configuration with SSL and a few url rewrites
#HTTP
server {
listen 80;
listen [IPv6]:80 default ipv6only=on;
server_name site www.site;
access_log /var/www/site/logs/nginx.access.log;
error_log /var/www/site/logs/nginx.error.log;