Skip to content

Instantly share code, notes, and snippets.

@ttscoff
ttscoff / sizes.rb
Last active Jul 12, 2021
sizes: Calculate and sort all filesizes for current folder
View sizes.rb
#!/usr/bin/env ruby
# Sizes - Calculate and sort all filesizes for current folder Includes
# directory sizes, colorized output Brett Terpstra 2019 WTF License
VERSION = "1.0.1"
require 'shellwords'
# Just including term-ansicolor by @flori and avoiding all the
# rigamarole of requiring multiple files when it's not a gem... - Brett
#
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active Sep 17, 2021
How to view-source of a Chrome extension
View how-to-view-source-of-chrome-extension.md

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@samaaron
samaaron / Reich Phase - Overtone
Last active Dec 26, 2019
Steve Reich's Piano Phase - Sonic Pi vs Overtone
View Reich Phase - Overtone
(ns overtone.examples.compositions.piano-phase
(:use overtone.live
overtone.inst.sampled-piano))
;; Steve Reich's Piano Phase
(def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])
(defn player
[t speed notes]
@lambdamusic
lambdamusic / README.md
Last active Nov 30, 2020
Nature.com archive statistics
View README.md
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active Aug 26, 2021
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter
View jupyter_shortcuts.md

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

@wikier
wikier / SPARQLWrapper-HTTP-Digest-Auth-example.py
Last active Mar 29, 2018
SPARQLWrapper HTTP Digest Auth example
View SPARQLWrapper-HTTP-Digest-Auth-example.py
from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST
sparql = SPARQLWrapper("http://example.org/sparql")
sparql.setHTTPAuth(DIGEST)
sparql.setCredentials('login', 'password')
sparql.setQuery("...")
sparql.setReturnFormat(JSON)
@natelandau
natelandau / .bash_profile
Last active Sep 11, 2021
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@eyaler
eyaler / graph.json
Last active Jun 25, 2021
Force-Directed Graph with Drag/Zoom/Pan/Center/Resize/Labels/Shapes/Filter/Highlight
View graph.json
{
"graph": [],
"links": [
{"source": 0, "target": 1},
{"source": 0, "target": 2},
{"source": 0, "target": 3},
{"source": 0, "target": 4},
{"source": 0, "target": 5},
{"source": 0, "target": 6},
{"source": 1, "target": 3},
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active Sep 2, 2021
Creating an IPython Notebook programatically
View ProgrammaticNotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hvtuananh
hvtuananh / unicode_csv.py
Created Feb 5, 2014
Python Unicode CSV Reader/Writer (fix writerow problem in Python docs)
View unicode_csv.py
#http://docs.python.org/2.7/library/csv.html
import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)