Skip to content

Instantly share code, notes, and snippets.

View davidhalter's full-sized avatar

Dave Halter davidhalter

View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@asmeurer
asmeurer / parso_inside_string.py
Created February 8, 2018 22:54
parso inside_string
"""
An attempt at an implementation of inside_string() using parso
inside_string(s, row, col) should return True if (row, col) is inside a string in the (partial) Python code s. (row is 1-based and col is 0-based)
Here is a version using tokenize that I am pretty sure is correct (it has tests) https://github.com/asmeurer/mypython/blob/796a33c8b029f5ee7096bf153db9d59a8220bb01/mypython/tokenize.py#L140
Two bugs I found so far:
- parso counts the newline as col 0 after the first line
@dweldon
dweldon / meteor-nginx
Last active January 22, 2024 06:53
This is an example of how to configure nginx to serve a meteor app.
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
@davidhalter
davidhalter / gist:4595055
Created January 22, 2013 14:32
download grooveshark favorites and song collection (with library).
#!/usr/bin/env python
import os
import json
import grooveshark
client = grooveshark.Client()
client.init()
@davidhalter
davidhalter / Makefile
Created April 29, 2012 20:00
Makefile. No filenames needed.
# -------------------------------------------------------
# Makefile to build whatever you want.
# It tries to find all the sources you have and builds
# dependencies, to detect header file changes.
# This is especially helpful for C/C++ beginners,
# who don't want to edit a Makefile.
# https://gist.github.com/2552967
# Written by David Halter <davidhalter88@gmail.com>
# -------------------------------------------------------
CC=g++