Skip to content

Instantly share code, notes, and snippets.

def query():
submissions = []
cursor = db.execute('SELECT * FROM links WHERE submitter_id = 62443 ORDER BY submitted_time ASC')
for link_tuple in cursor:
link = Link(*link_tuple)
submissions.append(link.id)
return submissions
print query()
$(".results").bind("DOMSubtreeModified", function () {
sideBar.setOffset();
});
from itertools import groupby
import os
from copy import deepcopy, copy
default_pos = [['-', '-', '-'], ['-', '-', '-'], ['-', '-', '-']]
class Board:
score = []
@dltacube
dltacube / app.js
Last active August 25, 2017 02:18
// adding this way adds literal text instead of DOM objects
$('table.adp-directions>tbody>tr')[step].after('<tr><td>TEXT!</td></tr>');
// this way the rows are properly added
$('table.adp-directions>tbody>tr').after(function (index, html) {
if (index == step) {
return('<tr><td>TEXT!</td></tr>')
}
});
@dltacube
dltacube / ratelimit.py
Last active February 7, 2018 16:59
example of how to rate limit your tmdb queries
import time
import requests
def query(query, collection):
URL = BASE_URL + '/' + collection + '/' + str(query['id'])
params = {'api_key': KEY}
if collection == 'tv' or collection == 'movie':
params = {
'api_key': KEY,
'language': 'en-US',
{
"results": [
{
"id": 10231,
"adult": false
},
{
"id": 57243,
"adult": false
},
“John Brennan, no single figure in American history has done more to discredit the intelligence community than this liar. Not only is he a liar, he’s a liar about being a liar.” Dan Bongino on @foxandfriends
@dltacube
dltacube / zsh_ignore_case
Created February 5, 2021 04:40 — forked from yohm/zsh_ignore_case
ignore case completion for zsh
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}'
@dltacube
dltacube / wombat_index.css
Last active March 27, 2021 19:24
from nest.com
.ak-youtubemodal {
display: none;
height: 100%;
left: 0;
opacity: 0;
position: fixed;
top: 0;
transform: scale(1.15);
transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
visibility: hidden;
@dltacube
dltacube / woombat_unique_words
Created March 27, 2021 19:49
rg '(\w+)' -o --replace '$1' | sort | uniq
0
0002
003
003h3
005
006
00625rem
007
008
00bfa5