Skip to content

Instantly share code, notes, and snippets.

1. Download your Twitter archive

You can find this feature in Settings > Download Twitter Archive. It might take 24 hours to receive. Unzip the file and open the data folder in your terminal:

cd ~/Downloads/twitter-archive-zip-you-downloaded/data

(I have seen reports that this function may no longer be working, so this guide is mostly useful to those who were lucky enough to already have downloaded their archive.)

@PaulKinlan
PaulKinlan / applyTemplate.js
Last active September 12, 2018 08:02
Simple Templating
const applyTemplate = (templateElement, data) => {
const element = templateElement.content.cloneNode(true);
const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, () => NodeFilter.FILTER_ACCEPT);
while(treeWalker.nextNode()) {
const node = treeWalker.currentNode;
for(let bindAttr in node.dataset) {
let isBindableAttr = (bindAttr.indexOf('bind_') == 0) ? true : false;
if(isBindableAttr) {
let dataKeyString = node.dataset[bindAttr];
@Dan-Q
Dan-Q / jack-fm-logger.rb
Last active September 25, 2017 15:03
Polls the Jack FM website every 60 seconds to see what song they're playing, and records it to an SQLite database. More details at https://danq.me/2017/03/13/jack-fm/.
#!/usr/local/rvm/wrappers/ruby-2.3.0@jack-fm-logger/ruby
require 'open-uri'
require 'sqlite3'
require 'nokogiri'
# Load DB, create schema if absent
db = SQLite3::Database.new 'log.db'
db.execute "CREATE TABLE IF NOT EXISTS plays (time INTEGER, artist TEXT, song TEXT);"
# Utility functions
@spikeheap
spikeheap / stdin_reader.rb
Last active August 7, 2021 15:36
Reading STDIN with threads in Ruby
require 'thread'
queue = Queue.new
producer = Thread.new do
loop do
key = STDIN.getch
queue << key if key
end
end

csv,conf,v2

Ben Foxall, Serving CSV from the browser

  • @benjaminbenben @pusher

why do I love CSV?

  • accessibility - don’t need specialized programs
  • it’s the start of something, not the end
@omgmog
omgmog / gulpfile.js
Created October 15, 2015 09:36
sass/postcss magic
var gulp = require('gulp');
var sass = require('gulp-sass');
var cssc = require('gulp-css-condense');
var postcss = require('gulp-postcss');
var pixrem = require('gulp-pixrem');
// Process Sass to CSS
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
@staltz
staltz / introrx.md
Last active April 15, 2024 10:24
The introduction to Reactive Programming you've been missing
@xem
xem / codegolf.md
Last active March 22, 2024 15:41
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@lukekarrys
lukekarrys / readme.md
Last active December 21, 2017 10:38
Deploy a subdirectory in your NodeJS Git project to GitHub pages.

Deploy a subdirectory in your NodeJS Git project to GitHub pages.

  1. Make sure node build outputs some static files to _built.
  2. npm run deploy.

This eventually became this blog post and this module

@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");