Skip to content

Instantly share code, notes, and snippets.

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active March 20, 2025 03:57
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trestletech
trestletech / server.R
Last active December 15, 2023 15:06
Show the headers in a Shiny app
library(shiny)
shinyServer(function(input, output, session) {
output$summary <- renderText({
ls(env=session$request)
})
output$headers <- renderUI({
selectInput("header", "Header:", ls(env=session$request))
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@atupal
atupal / select_input.py
Created June 26, 2013 06:36
Keyboard input with timeout in Python
import sys, select
print "You have ten seconds to answer!"
i, o, e = select.select( [sys.stdin], [], [], 10 )
if (i):
print "You said", sys.stdin.readline().strip()
else:
print "You said nothing!"
@brokendish
brokendish / talk.sh
Created February 3, 2013 13:09
「open-jtalk」日本語音声合成実行用シェル 「-ow」で指定したWAVファイル(~/open-talk.wav)で保存される。 その他に、数値の部分を適当にいじると話速、声質、ピッチが変えられる。
#!/bin/sh
TMP=~/open-talk.wav
touch $TMP
cd /usr/share/hts-voice/nitech-jp-atr503-m001
#cd /usr/share/hts-voice/mei_happy
echo "$1" | open_jtalk \
-td tree-dur.inf \
-tf tree-lf0.inf \
-tm tree-mgc.inf \
-md dur.pdf \
@nrk
nrk / command.txt
Created April 2, 2012 19:19
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"