Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# This will need the investigate module installed via 'pip install investigate'
import investigate, json, fileinput, codecs, sys, os, requests, time, re
def slice(l, n):
n = max(1, n)
return [l[i:i + n] for i in range(0, len(l), n)]
# Read key, single line
with open('api-key.txt', 'r') as k:
@jdembowski
jdembowski / bulk-enforcement.py
Last active August 1, 2018 17:19
Enforcement API excercise
#!/usr/bin/python
# This will need the investigate module installed via 'pip install investigate'
import investigate, json, fileinput, codecs, sys, os, requests, time, re
def slice(l, n):
n = max(1, n)
return [l[i:i + n] for i in range(0, len(l), n)]
# Read key, single line
with open('api-key.txt', 'r') as k:
@jdembowski
jdembowski / functions.php
Created July 22, 2018 12:04
Doctorial Child theme functions.php file
<?php
add_action( 'wp_enqueue_scripts', 'doctorial_child_enqueue_styles' );
function doctorial_child_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
@jdembowski
jdembowski / style.css
Created July 22, 2018 12:04
Child theme style.css file for Doctorial
/*
Theme Name: Doctorial Child theme
Description: A Child theme to remove the theme author's credits from the theme's footer
Version: 0.1
Template: doctorial
*/
Slic3r 1.2.9
Start G-code
M116 ; Wait until target temperatures for extruder and heated bed are reached
G28 ; home all axes
M117 Printing...
G0 Z0.3 ; drop to start height
G0 Y3 ; move to edge of print area
G0 X50 F5000 ; move to front of bed
@jdembowski
jdembowski / list-domains.py
Last active October 25, 2017 01:19
Read all the domains in an Umbrella Enforcement API integration
#!/usr/bin/python
import urllib2, json, fileinput, sys, os, time
from datetime import datetime
from time import gmtime, strftime
# Read key, single line
with open('api-key.txt', 'r') as k:
api_key = k.read().rstrip()
#!/usr/bin/python
# This will need the investigate module installed via 'pip install investigate'
import investigate, time, json, fileinput, codecs, sys, os
def slice(l, n):
n = max(1, n)
return [l[i:i + n] for i in range(0, len(l), n)]
#!/usr/bin/python
import os, sys, json
from time import sleep
from urllib2 import Request, urlopen, URLError, HTTPError
# From https://stackoverflow.com/questions/3462784/check-if-a-string-matches-an-ip-address-pattern-in-python
def validate_ip(s):
a = s.split('.')
if len(a) != 4:
@jdembowski
jdembowski / functions.php
Created March 4, 2017 14:47
Remove nag notices from Swell Lite theme
<?php
// Queue up the child theme CSS
add_action( 'wp_enqueue_scripts', 'cleanretina_child_enqueue_styles' );
function cleanretina_child_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
@jdembowski
jdembowski / functions.php
Last active March 4, 2017 04:41
Clean Retina Child theme functions.php file
<?php
// Queue up the child theme CSS
add_action( 'wp_enqueue_scripts', 'cleanretina_child_enqueue_styles' );
function cleanretina_child_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );