Skip to content

Instantly share code, notes, and snippets.

@epitron
epitron / lugcast.js
Last active July 3, 2016 18:18
An audio player I wrote for the SteamLUG Podcast (https://steamlug.org/cast). It highlights the transcript as the audio is playing, and lets you jump around in the audio by clicking the transcript.
(function () {
"use strict";
function time_to_seconds(time) {
var s = time.attributes.datetime.value.split(":");
return parseInt(s[0] * 3600, 10) + parseInt(s[1] * 60, 10) + parseInt(s[2], 10);
}
var highlighter = {
@amberj
amberj / rev-youtube-playlist-urls.sh
Created May 7, 2012 23:52
This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order
#!/bin/bash
#
# File: rev-youtube-playlist-urls.sh
# Description: This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order (i.e. starting from last video in playlist)
# Author: Amber Jain
# Check if "only one" argument (playlist_url) passed as input:
if [ "$#" -lt "1" ]
then
echo "Invalid! You must pass playlist_url as argument"
@leoherzog
leoherzog / *Set-up.md
Last active August 10, 2022 21:50
A Bash Script to Make RSS Feeds into Kindle Books

Grab a feed and make a Kindle book out of it's latest entry

This script downloads an RSS feed, assembles it's latest entry into a nice HTML file, downloads all of the assets required, generates a Kindle .mobi book with Amazon's official tool, sends me a Pushbullet notification that it worked, and uploads the .mobi book to my Dropbox.

If you wanted, you could then have a tool like this upload it to your Kindle wirelessly.

Set-up:

  • Copy parse.sh and dropbox_uploader.sh to your working directory that you'd like the script to live
  • chmod +x parsh.sh dropbox_uploader.sh
@apolloclark
apolloclark / Twitter API with Curl
Last active November 10, 2023 11:36
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@frabert
frabert / COPYING
Last active December 21, 2023 13:35
Favicons for HN
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@bpierre
bpierre / README.md
Last active February 15, 2024 18:40
Switch To Vim For Good

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@cirrusUK
cirrusUK / .Xresources
Last active April 3, 2024 11:19
termite emulator orange theme and other stuff
! __ ___ __ ___ ___ ___ _ _ _ __ ___ ___ ___
! \ \/ / '__/ _ \/ __|/ _ \| | | | '__/ __/ _ \/ __|
! _ > <| | | __/\__ \ (_) | |_| | | | (_| __/\__ \
!(_)_/\_\_| \___||___/\___/ \__,_|_| \___\___||___/
!
!## Colors
#define S_base03 #191919
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
@pamelafox
pamelafox / top_movies.sql
Last active April 4, 2024 06:39
Top 100 Movies
/* Source: http://www.boxofficemojo.com/alltime/world/ */
CREATE TABLE topmovies(
Rank INTEGER,
Title TEXT,
Studio TEXT,
Worldwide REAL,
Domestic REAL,
DomesticPct REAL,
Overseas REAL,
OverseasPct REAL,
@pamelafox
pamelafox / solar_system_objects.sql
Last active April 4, 2024 06:41
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */