Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import csv
import sys
import subprocess
from collections import namedtuple
DiskTrack = namedtuple("DiskTrack", "disk track episode name filename")
brandonhesse /
Created Mar 19, 2016
Modified a script I found in /r/learnpython
Downloads images from the ~NEW~ section on and stores them for later use
Created by Roulx
Modified by midelh
# I'm in python3 on this PC,
# so this should allow me to use my print and you can still run this in py2
from __future__ import print_function
import json #json over csv, personal preference
View directive.js
ng.directive('smGroup', ['$cacheFactory', '$log', function ($cacheFactory, $log) {
var cache = $cacheFactory('smGroupModelCache');
function searchAndDestroy(array, target) {
var index, found;
if (!Array.isArray(array)) {
return false;
View checkbox.js
(function () {
'use strict';
var checkbox = (function checkBoxBuilder() {
var prototype = {
values: function () {
var keys = Object.keys(this);
var type = this;
return keys.filter(function (key) {
return type[key];
View checkboxes.js
(function(ng, undefined) {
.factory('es6Macro', [function es6Macro() {
// ECMAScript6 style string replacement implemented in ES5
return function macro(replace, macroString) {
var compiled = macroString,
keyR = Object.keys(replace),
replacementR = (key) {
return new RegExp('\\${' + key + '}', 'g');
}), keyIdx, replacementCnt = replacementR.length;
from __future__ import print_function
from argparse import ArgumentParser, Namespace
import subprocess
import logging
import sys
import os.path
import configparser as cp
View product_dept.txt
social/sys/classes/mvses.reports.class.php:139: LEFT JOIN product_dept pd ON t.ptype =
social/sys/classes/mvses.credits.class.php:238: LEFT JOIN product_dept pd ON p.department_id =
social/sys/func/cron.sync.system_updates.php:87: $dept = $mydb->GetOne("SELECT department FROM product_dept WHERE id={$deptid}");
social/sys/era404.mvses.setup.php:155:echo "<b>====|| CREATING product_dept TABLE:<br /></b><ul>";
social/sys/era404.mvses.setup.php:156: $query = "CREATE TABLE IF NOT EXISTS product_dept (
social/sys/era404.mvses.setup.php:180:echo "<b>====|| POPULATING product_dept TABLE:<br /></b><ul>";
social/sys/era404.mvses.setup.php:182: $query = "INSERT IGNORE INTO product_dept (id, department, item) VALUES ($did, '{$d[0]}','{$d[1]}')";
brandonhesse / matches.js
Last active Aug 29, 2015
Matches in both items
View matches.js
.filter('findMatches', [function() {
return function findMatches(arr1, arr2) {
// We cache because JS has some funny properties.
var len1, len2, i, j, matches, match;
// Because you're passing in strings
arr1 = arr1.split(' ');
arr2 = arr2.split(' ');
// Since the container will always be filled with matches
matches = [];
brandonhesse / SerializerDecoratorSample.php
Created Apr 16, 2015
Sample of what modular serializer might look like
View SerializerDecoratorSample.php
interface DecoratorInterface {
public function dectorate($value, array $options);
public function supports($class);
class InvalidDecoratorSerilizationException extends \Exception {};
class DateTimeDecorator impliments DecoratorInterface {
You can’t perform that action at this time.