Skip to content

Instantly share code, notes, and snippets.

@tedtieken
tedtieken / wiki-100k.txt
Created January 30, 2022 22:57 — forked from abamacus/wiki-100k.txt
Wictionary top 100,000 most frequently-used English words [for john the ripper]
This file has been truncated, but you can view the full file.
#!comment: This allegedly waa a list of "the top 100,000 most frequently-used English words", see the repo I forked for more provenance.
#!comment: But it was very un-sanitized. I had a specific purpose in mind, and thought it might be somewhat more generally useful to have/share in the future, so here's how I sanitized the list:
#!comment: 0) put a number on each word (I should note that somehow it only included 98,913 to start with)
#!comment: 1) change all words to lower-case
#!comment: 2) blank out any words with characters other than a-z
#!comment: 3) remove any duplicates, keeping the lower (more frequent) number
#!comment: Now the list is 62916 words long, and still contains a lot of non-English words, but I think it is more useful.
#!comment:
#!comment: Format: Rank (original rank) Word
1 (1) the
@tedtieken
tedtieken / block_personal_appts
Created August 25, 2020 01:55 — forked from alranel/block_personal_appts.js
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
// ID(s) of personal calendar(s)
var secondary_calendars = [
'xxxxxxx',
];
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+90); // how many days in advance to monitor and block off time
@tedtieken
tedtieken / shopify_api.conf
Created May 31, 2016 19:54 — forked from rdetert/shopify_api.conf
Sync Shopify Customers who Accept Marketing with Sendy Using ActiveRecord 4
SHOPIFY_API_KEY = 'my-key'
SHOPIFY_PASSWORD = 'my-pass'
STORE_NAME = 'my-store'
@tedtieken
tedtieken / bulk import shipping rates
Created May 26, 2016 18:07 — forked from leobossmann/bulk import shipping rates
Bulk create/delete shipping rates in the Shopify backend. Go to Settings/Shipping and paste it into Javascript console. WARNING: This is a proof of concept, use with extreme caution and only if you know what you're doing, you will have to customize this to fit your needs. Again, just a proof of concept, worked for me, might not work for you. Ong…
function make_shipping_rates(id, low, mid, high) {
$.post('/admin/price_based_shipping_rates.json', {
price_based_shipping_rate: {
country_id: id,
min_order_subtotal: "0",
max_order_subtotal: "500",
name: "DHL Premiumversand",
offsets: [],
price: low
}
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
@tedtieken
tedtieken / gist:6567112
Created September 15, 2013 00:50
Demonstrating that the two envelopes paradox is actually a fallacy.
import random
envs = [10.0, 20.0]
rounds = 10000
total_stay = 0
for x in xrange(rounds):
  t_envs = envs[:]
  random.shuffle(t_envs)
  choice = t_envs.pop()
@tedtieken
tedtieken / fabfile.py
Created December 5, 2012 17:36 — forked from jpennell/fabfile.py
Fabric fabfile for Django/Heroku App
from fabric.api import env, local, require
def deploy():
"""fab [environment] deploy"""
require('environment')
maintenance_on()
push()
syncdb()
migrate()
@tedtieken
tedtieken / verbatim_templatetag.py
Created November 14, 2012 02:26 — forked from paulsmith/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
or like:
{% if condition %} print {%= object.something %} {% endif %}
This, of course, completely screws up Django templates,
@tedtieken
tedtieken / paginated_collection.js
Created August 22, 2012 22:39 — forked from takinbo/paginated_collection.js
Pagination with Backbone.js & django-tastypie
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by');
typeof(options) != 'undefined' || (options = {});
typeof(this.limit) != 'undefined' || (this.limit = 20);
typeof(this.offset) != 'undefined' || (this.offset = 0);
typeof(this.filter_options) != 'undefined' || (this.filter_options = {});
typeof(this.sort_field) != 'undefined' || (this.sort_field = '');
@tedtieken
tedtieken / django_2012.md
Created August 5, 2012 18:17 — forked from trey/django_2012.md
How to start a Django project in 2012

How to start a Django project in 2012

(and deploy to Heroku)

First, warm up system.

$ easy_install pip
$ pip install virtualenv
$ pip install django
$ gem install heroku