Skip to content

Instantly share code, notes, and snippets.

View rxw1's full-sized avatar
☠️

rxw1

☠️
  • Germany
View GitHub Profile
@jlewin
jlewin / parseYouTubeTranscript.js
Last active December 10, 2015 23:28
Extract a quote from YouTube transcripts
// Usage: Open the transcript view, select the line to start at, and call getQuoteFromVideo
// passing it just the number of lines to collect
// or
// Call getQuoteFromVideo passing it the number of lines to collect and an element id to start at
function getQuoteFromVideo(count, captionStartID){
var captionLine = document.querySelector(captionStartID || '.caption-line-highlight');
var text = '';
for(var i = 0; i < count && captionLine; i++){
text += captionLine.querySelector('.caption-line-text').textContent + ' ';
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@chrK
chrK / pdf-date-rename
Last active December 11, 2015 18:38
********* Moved to: https://github.com/chrK/pdf-rename ********* A Simple script to parse dates from pdfs and rename them with a date prefix and a keyword. Run the script inside the folder with the pdfs you want to rename. ! Attention: This renames and moves your files. Be sure to have backups of the data you're working on.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, getopt, os, re, time, locale, csv
from cStringIO import StringIO
try:
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@jramnani
jramnani / plan9port.rb
Created February 24, 2013 18:27
Homebrew formula for plan9port
require 'formula'
class Plan9port < Formula
homepage 'http://swtch.com/plan9port/'
url 'https://bitbucket.org/rsc/plan9port', :using => :hg, :tag => '697c23cebcec'
version '20120603'
md5 '18993b6993950864f7fb95f73ac47168'
head 'https://bitbucket.org/rsc/plan9port', :using => :hg
keg_only "plan9port includes system programs like 'cat' and 'awk', and you may not want to override their OS X equivalents."
@kristopherjohnson
kristopherjohnson / formatjson.js
Last active May 25, 2025 20:08
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();
var hzAdDebug = !1,
hzVersion = "4.11",
keywords, adCont, urlPrefix = "https:" == location.protocol ? "https://ssl14.ovh.net/~hoverzoo" : "http://hoverzoom.net";
function addAffiliateLinks() {
try {
if (0 != location.host.indexOf("www.amazon.")) {
var a = {
com: "-20",
fr: "-21",
@jonschlinkert
jonschlinkert / examples.md
Last active April 10, 2025 19:52
Three files: examples.md, yaml-cheatsheet.md and yaml-cheatsheet.yml

adapted from this blog

# YAML
name: Jon
# YAML
object:
@jlewin
jlewin / countTabs.js
Last active March 7, 2023 17:21
Count of open tabs in Chrome
chrome.windows.getAll({populate: true}, function(allWindows)
{
console.log(allWindows);
});
@robcowie
robcowie / .slate.js
Last active December 16, 2015 01:19
S.bind('l:ctrl', S.operation('corner', {
'direction': 'top-left',
'width': 'screenSizeX*0.75',
'height': 'screenSizeY'
}));
S.bind('r:ctrl', S.operation('corner', {
'direction': 'top-right',
'width': 'screenSizeX*0.25',