Skip to content

Instantly share code, notes, and snippets.

View Kevin-Prichard's full-sized avatar

Kevin Prichard Kevin-Prichard

  • Data Metaphysics
  • San Francisco, CA
View GitHub Profile
@Kevin-Prichard
Kevin-Prichard / makefixtures_filtered
Created June 11, 2014 20:54
Create fixtures using custom Django query/.filter expressions. Include and exclude models as desired. Very flexible.
#Based on https://github.com/ericholscher/django-test-utils/blob/master/test_utils/management/commands/makefixture.py
#v0.1 -- current version
#known issues:
#no support for generic relations
#no support for one-to-one relations
from optparse import make_option
from django.core import serializers
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
@Kevin-Prichard
Kevin-Prichard / json_data_dictionary.js
Last active September 13, 2015 04:52
Generate JSON data dictionary as key path list, for a JSON input (NodeJS). Helpful for analysing JSON documents and REST responses
#!/usr/bin/env node
var JSON = require('JSON');
var fs = require('fs');
var argv = require('yargs').argv;
var isObject = function(v) { return v && (typeof v==='object') && !('length' in v); };
var isArray = function(v) { return v && (typeof v==='object') && ('length' in v); };
var isPrimitive = function(v) { var res=(typeof v in {'boolean':true,'number':true,'string':true,'undefined':true}) || (v===null); return res;};
var keys = function(v) {keys=[]; for(var key in v){keys.push(key)} return keys};
This file has been truncated, but you can view the full file.
M190 S50.000000
M109 S195.000000
;Sliced at: Mon 14-09-2015 12:17:46
;Basic settings: Layer height: 0.1 Walls: 0.8 Fill: 20
;Print time: 2 hours 8 minutes
;Filament used: 2.995m 8.0g
;Filament cost: None
;M190 S50 ;Uncomment to add your own bed temperature line
;M109 S195 ;Uncomment to add your own temperature line
G21 ;metric values
This file has been truncated, but you can view the full file.
M190 S50.000000
M109 S195.000000
;Sliced at: Mon 14-09-2015 12:12:50
;Basic settings: Layer height: 0.1 Walls: 0.8 Fill: 20
;Print time: 1 hour 53 minutes
;Filament used: 2.729m 8.0g
;Filament cost: None
;M190 S50 ;Uncomment to add your own bed temperature line
;M109 S195 ;Uncomment to add your own temperature line
G21 ;metric values
This file has been truncated, but you can view the full file.
M190 S50.000000
M109 S195.000000
;Sliced at: Mon 14-09-2015 12:14:56
;Basic settings: Layer height: 0.1 Walls: 0.8 Fill: 20
;Print time: 2 hours 2 minutes
;Filament used: 2.364m 7.0g
;Filament cost: None
;M190 S50 ;Uncomment to add your own bed temperature line
;M109 S195 ;Uncomment to add your own temperature line
G21 ;metric values
This file has been truncated, but you can view the full file.
M190 S50.000000
M109 S195.000000
;Sliced at: Mon 14-09-2015 12:16:28
;Basic settings: Layer height: 0.1 Walls: 0.8 Fill: 20
;Print time: 1 hour 45 minutes
;Filament used: 2.5m 7.0g
;Filament cost: None
;M190 S50 ;Uncomment to add your own bed temperature line
;M109 S195 ;Uncomment to add your own temperature line
G21 ;metric values
@Kevin-Prichard
Kevin-Prichard / download_and_delete_slack_files.py
Created July 30, 2018 04:57
How to deal with: "Your file was uploaded — it’s safe and sound in Slack. Unfortunately your workspace doesn’t have any storage space left."
#!/usr/bin/env python2.7
import traceback
import requests
import shutil
import time
import json
import os
import re
@Kevin-Prichard
Kevin-Prichard / json_data_dictionary.js
Created March 3, 2022 01:19
JSON data dictionary generator: read json file, collect the key paths, write out report
#!/usr/bin/env node
//var JSON = require('JSON');
var fs = require('fs');
var argv = require('yargs').argv;
var isObject = function(v) { return v && (typeof v==='object') && !('length' in v); };
var isArray = function(v) { return v && (typeof v==='object') && ('length' in v); };
var isPrimitive = function(v) { var res=(typeof v in {'boolean':true,'number':true,'string':true,'undefined':true}) || (v===null); return res;};
var keys = function(v) {keys=[]; for(var key in v){keys.push(key)} return keys};
@Kevin-Prichard
Kevin-Prichard / symlink-flatpak-app-to-gnome-shell.md
Created November 9, 2022 01:48
How can I symlink a Flatpak app to Gnome Shell Desktop