Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Why is everything always broken?

Jason Kulatunga AnalogJ

🔥
Why is everything always broken?
View GitHub Profile
@AnalogJ
AnalogJ / download_opds.py
Created Aug 29, 2017
download all books in OPDS catalog.
View download_opds.py
import urllib2
import os
import urllib, urlparse
import xml.etree.cElementTree as et
e = et.ElementTree(file=urllib2.urlopen('https://standardebooks.org/opds/all')).getroot()
print(e)
print("parsing")
for atype in e.iter('{http://www.w3.org/2005/Atom}link'):
@AnalogJ
AnalogJ / GIF-Screencast-OSX.md
Created Aug 25, 2017 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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:

View keybase.md

Keybase proof

I hereby claim:

  • I am analogj on github.
  • I am analogj (https://keybase.io/analogj) on keybase.
  • I have a public key whose fingerprint is 3622 45F4 CC04 8DBD F5E9 AA2F 8CBB DF95 5412 11AB

To claim this, I am signing this object:

@AnalogJ
AnalogJ / rss feed
Created Jul 19, 2015
superfeedr payload
View rss feed
service | 2015-07-19T21:19:03.180407900Z I, [2015-07-19T21:19:03.179285 #1] INFO -- : PAYLOAD: {
service | 2015-07-19T21:19:03.180407900Z "status": {
service | 2015-07-19T21:19:03.180407900Z "code": 304,
service | 2015-07-19T21:19:03.180407900Z "http": "Fetched (ring) 304 900",
service | 2015-07-19T21:19:03.180407900Z "nextFetch": 1437341161,
service | 2015-07-19T21:19:03.180407900Z "velocity": 0.5,
service | 2015-07-19T21:19:03.180407900Z "popularity": 0.92,
service | 2015-07-19T21:19:03.180407900Z "period": 900,
service | 2015-07-19T21:19:03.180407900Z "lastFetch": 1437340261,
service | 2015-07-19T21:19:03.180407900Z "lastParse": 1437337372,
@AnalogJ
AnalogJ / sails_ducktyping_for_background_tasks.js
Created Jul 21, 2014
Ducktyping Sailsjs for Background Tasks via Kue. See http://blog.thesparktree.com
View sails_ducktyping_for_background_tasks.js
var _ = require('lodash'),
Waterline = require('waterline'),
path = require('path'),
url = require('url'),
kue = require('kue'),
redis = require('../../node_modules/sails/node_modules/socket.io/node_modules/redis'),
q = require('q')
////////////////////////////////////////////////////////////////////
@AnalogJ
AnalogJ / init.d-hub
Created Oct 10, 2013
Daemons, init.d, symlinks, Control file
View init.d-hub
#!/usr/bin/env ruby
$: << File.expand_path(File.dirname(File.realpath(__FILE__)))
$: << File.expand_path(File.dirname(File.symlink?(__FILE__) ? File.readlink(__F$
require 'rubygems'
require 'daemons'
require 'bundler'
puts File.expand_path(File.dirname(File.realpath(__FILE__)))
ENV['BUNDLE_GEMFILE'] = File.expand_path('Gemfile',File.dirname(File.realpath(_$
Bundler.require
@AnalogJ
AnalogJ / generate.js
Last active Dec 22, 2015
Chi's map design.
View generate.js
//PHP Pages
<%
id = request["id"];
timestamp = request["timestamp"]
points = Database lookup for points where id = id && timestamp == timestamp
set header content exipry = never
@AnalogJ
AnalogJ / child.txt
Last active Dec 21, 2015
please.js snippet
View child.txt
$(function () {
$('.js-close').click(function() {
window.close();
});
please.init(window);
please.defaults({
// reference to the window to send messages to
@AnalogJ
AnalogJ / gist:6315128
Last active Dec 21, 2015
Google Signet Gem OAuth2 Example
View gist:6315128
oauth_client = Signet::OAuth2::Client.new(authorization_uri: 'https://accounts.google.com/o/oauth2/auth', token_credential_uri: 'https://accounts.google.com/o/oauth2/token', client_id: 'CLIENT_ID', client_secret: 'CLIENT_SECRET', redirect_uri: 'urn:ietf:wg:oauth:2.0:oob', scope: 'https://www.googleapis.com/auth/tasks')
oauth_client.authorization_uri
# => #<Addressable::URI:0x1223b74 URI:https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/tasks>
oauth_client.update! code: 123456
oauth_client.authorization_uri
# => nil
oauth_client.client_id
# => nil
oauth_client.client_secret
# => nil
@AnalogJ
AnalogJ / DO I LOOK LIKE I GIVE A SHIT PUBLIC LICENSE
Created Jul 26, 2013
DO I LOOK LIKE I GIVE A SHIT PUBLIC LICENSE
View DO I LOOK LIKE I GIVE A SHIT PUBLIC LICENSE
DO I LOOK LIKE I GIVE A SHIT PUBLIC LICENSE
Version 1, July 2013
Copyright (C) 2013 Sam Levy <sam@samuellevy.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO I LOOK LIKE I GIVE A SHIT PUBLIC LICENSE