Skip to content

Instantly share code, notes, and snippets.

View nst's full-sized avatar

Nicolas Seriot nst

View GitHub Profile
@nst
nst / twitter.py
Created August 17, 2012 03:58
Twitter webscrapping
#!/usr/bin/env python
"""Twitter webscrapping, works on 2012-08-17
$ python twitter.py
@RonaldHayden | Firing up Uncharted 2 thanks to @chuckdude -- y'all have raised my expectations!
@CocoaSamurai | My list of Go features i'd love to see in Objective-C goo.gl/VB1Zk forgot to tweet this earlier
@slashdot | Dremel-Based Project Accepted As Apache Incubator bit.ly/N7np9P
"""
@nst
nst / mail_save_attachments.txt
Created September 21, 2012 11:53
Save attachments of selected messages in OS X Mail.app, mark the messages as read.
-- file: mail_save_attachments.txt
-- author: Nicolas Seriot
-- date: 2012-09-18
-- description: save attachments of selected messages in mail, mark the messages as read
-- usage: $ osascript mail_save_attachments.txt /some/directory
on run parameters
using terms from application "Mail"
set saveDirectory to item 1 of parameters
tell application "Mail" to set theSelectedMessages to selection
$ ./clitter -all YES
Clitter displays the latest favorites by your friends, using OS X settings.
By default, it remembers the latest position and will fetch only new one.
USAGE: ./clitter ([-pos POSITION] | [-all YES])
Account: nst021
Current position: 1382780540116
----------
Sat Oct 26 09:42:20 +0000 2013 @FredericJacobs favorited:
393960909083009024 [F 4] [R 4] @dlshadothman The @dailymail published an article about Aymta with a lot of wrong information.No one contacted me before publishing the article
@nst
nst / gist:8052682
Created December 20, 2013 09:55
Use STTwitter to access direct messages with web-based authentication and reverse authentication
STTwitterAPI *twitter = [STTwitterAPI twitterAPIWithOAuthConsumerName:nil
consumerKey:CONSUMER_KEY
consumerSecret:CONSUMER_SECRET];
[twitter postReverseOAuthTokenRequest:^(NSString *authenticationHeader) {
STTwitterAPI *twitterAPIOS = [STTwitterAPI twitterAPIOSWithFirstAccount];
[twitterAPIOS verifyCredentialsWithSuccessBlock:^(NSString *username) {
__Add Submodule__
git submodule add https://github.com/username/Module
┌─────────────────────────┐
│ MyProject │
│ ┌────────────────┐ │
│ │ Module │ │
│ └────────────────┘ │
└─────────────────────────┘
@nst
nst / request.swift
Last active May 3, 2016 08:35
NSURLRequest extension with curl description, fetch data and typed JSON, success and failure closures with status, headers and errors
see https://github.com/nst/HTTPRequests
@nst
nst / strava_to_doarama.py
Created August 13, 2016 13:48
Fix GPX paths exported from Strava by restoring the timestamp
#!/usr/bin/env python
"""
For some reason, Strava lets you export the GPX of another athletes but removes
the timestamps, presumably so that you can't "steal" their paths.
This script adds fake timestamps to these GPX files, so that you see the
overview of the run in other services like doarama for instance.
Technically, the script adds a timstamp after the </ele> tag, +1s at each point:
@nst
nst / test_json.go
Created October 18, 2016 22:46
A quick assessment of Go JSON parser conformance to RFC 7159
// go build test_json.go
// echo -n "[1e1000]" > n.json
// ./test_json n.json
// echo $? # 0 - failed to parse valid JSON
// echo -en '["\xFF"]' > s.json
// ./test_json s.json
// echo $? # 1 - parsed invalid JSON
@nst
nst / eca.py
Last active October 29, 2017 12:33
#!/usr/bin/python
__author__ = "Nicolas Seriot"
__date__ = "2017-05-24"
# http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
# https://en.wikipedia.org/wiki/Rule_110
import png

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: