Skip to content

Instantly share code, notes, and snippets.

@mchow01
mchow01 / TWTR-psql.py
Last active December 21, 2020 04:25
Store tweets from a Twitter timeline into a PostgreSQL database using Tweepy
import tweepy
import psycopg2
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html
# psycopg2 API doc here: http://initd.org/psycopg/docs/
# Keys
consumer_key = ''
consumer_secret = ''
access_token = ''
@keikoro
keikoro / git_cheatsheet.md
Last active April 12, 2017 16:36
git – personal cheat sheet

Committing

empty initial commit
$ git commit --allow-empty -m "initial commit"

Branches

create a "blank" branch (coming from an existing branch)
and remove all files and directories in the current directory
$ git checkout --orphan newbranch

@lindaliukas
lindaliukas / gist:53429e85e1d36ae81e20
Last active August 29, 2015 14:15
Principles of play links
@katemonkeys
katemonkeys / gist:e17580777b57915f5068
Last active July 16, 2024 16:00
Everything Wrong With The Withings API

Top Six Things You Need To Know About The Withings API*

*where “you” is probably a developer, or at least a strange user

I should preface this by saying that I got a Withings Smart Body Analyzer for Christmas last year and I’ve been generally happy with it. It purports to be able to take my heart rate through my bare feet and that seems not to work for my physiology, but overall I’m a fan. If if their Wikipedia page is to be believed they are having a pretty rad impact on making the Quantified Self movement more for normal people and they only have 20 full time employees. Also they try hard to use SI units, which I can get behind. Anyway, on to the rant.

I originally called this post “Everything wrong with the Withings API” and I meant it. For every useful field I can extract from their “award winning” app, I have spent an hour screaming at the inconsistencies in their implementation or inexplicable holes in their data

@oilvier
oilvier / bookmark.js
Last active March 7, 2025 06:07
Javascript to add a bookmark - Cross Browser
/**
*
* Add to bookmark
* Several tests are necessary in order for this "simple" action to work in most of the browsers
*
*/
// First, we define the element where the "Add to bookmark" action will trigger
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag
@moonmilk
moonmilk / README.md
Last active February 2, 2025 15:46
manually authorize a twitter app to a twitter account

So you're writting a twitterbot and you need to authorize your application to post to the account. You need an access token and secret for the account you're posting to. If the posting account is the same account that owns the application, no problem, you just push the button on your application's settings page to make the keys. But if you want to post to a different twitter account, there's no UI on apps.twitter.com to authorize it. So I made this bare-minimum node server to run through the authorization process. There's probably a much better way to do this, so please let me know what that way is!

ignore this and go down to the comments for better solutions

  • You'll need a server with node.js!
  • Make sure your application has a callback URL specified in its settings page, even if it's just a placeholder. If there's nothing in the callback URL slot, this method of authorization won't work.
  • In authorize.js, fill in your application's consumer key and secret, and the domain on which you'll be running th
@nicoddemus
nicoddemus / README.md
Last active April 15, 2022 19:23
Example on how to structure a package and testing modules

Arrange files like this:

apple/
  __init__.py
  apple.py
tests/
  test_everything.py
@ge045
ge045 / README.md
Last active January 20, 2018 17:00 — forked from mbostock/.block
#!/bin/bash
show_usage () {
echo "Usage: `basename $0` [START [END]]"
echo
echo "Steps through the commit history from START to END,"
echo "then returns to the branch or commit from before execution."
echo
echo "START defaults to the root commit (beginning of history)."
echo "END defaults to current branch/commit."
@barrysteyn
barrysteyn / svn-to-git.md
Last active October 10, 2024 12:27
Migrate From SVN To GIT