Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / checklist.fish
Last active August 29, 2015 14:15
This script search for all the lines beginning with '- [X] ' in all the files in a directory, where [X] could be [ ]/[-]/[-]
#!/opt/local/bin/fish
##########################################
# requires ag installed, optionally could
# be adapted to grep for a fewfiles
##########################################
# This script search for all the lines beginning with '- [X] ' in all the files in a directory, where [X] could be:
#[ ] = open item
#[x] = closed item
#[-] = ongoing item
#[?] = question item
@kidpixo
kidpixo / fswatch_checklist
Created February 12, 2015 10:30
Simple fswatch-er to trigger the checklist each time a file change (for check_list_simplenote see gist https://gist.github.com/kidpixo/9df8fc3298dfe84dc176)
fswatch -rx $checklist_path | while read event
set actual_pane_width (tmux list-panes | grep '(active)' | sed 's/^.: \[\(.*\)x.*/\1/')
# actual_pane_width + 11 take in account invisible ASCII escape characters
# used for color in check_list_simplenote
check_list_simplenote | cut -c 1-(echo $actual_pane_width"+11" | bc)
repeat = $actual_pane_width
repeat \n 5
end
@kidpixo
kidpixo / tmux_list_all_panes.fish
Created February 12, 2015 12:56
List hierarchically all window and panes in the input tmux session
# list all panes in the session specified in input
function tmux_list_all_panes
if not set -q $argv
echo $argv
for el in (tmux list-windows -t $argv)
echo " "$el
for elem in (tmux list-pane -t $argv:(echo $el | cut -d":" -f 1))
echo " "$elem
end
end
@kidpixo
kidpixo / CiscoVPNConnection.scpt
Last active May 29, 2016 09:36 — forked from twksos/CiscoVPNConnection.scpt
Cisco VPN Connection: Adapted for 10.8.5 notification window prompt "Enter Username and Password.".
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
set window_prompt to "Enter Username and Password." -- this works for OS X 10.8.5, check yours.
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
@kidpixo
kidpixo / toc.js
Created February 18, 2015 09:25
ipython extension for ToC, adapted from https://github.com/minrk/ipython_extensions to work with ipython 2.4.0
/*
Add this file and neighboring toc.css to $(ipython locate)/nbextensions/
And load it with:
require(["nbextensions/toc"], function (toc) {
console.log('Table of Contents extension loaded');
toc.load_ipython_extension();
// If you want to load the toc by default, add:
// $([IPython.events]).on("notebook_loaded.Notebook", toc.table_of_contents);
@kidpixo
kidpixo / tmuxinator_conf.yml
Created April 10, 2015 10:04
tmuxinator yml configuration
# ~/.tmuxinator/mertis.yml
name: pipeline_develop
root: ~/
post: tmux select-window -t :scosreader
# Optional tmux socket
# socket_name: foo
# Runs before everything. Use it to start daemons etc.
# useful imports
import pathlib
import numpy as np
import pandas as pd
# define pandas options
opts = {
'display.max_columns': None,
'display.max_colwidth': 50,
'display.expand_frame_repr': False, # Don't wrap to multiple pages
'display.max_rows': 14, # maximum number of rows pandas should output
# set opacity of blayer 0 and redraw
def setopacity(layer,opacity):
layer.renderer().setOpacity(opacity)
layer.triggerRepaint()
# Load some basic configuration
# %load https://gist.githubusercontent.com/kidpixo/2ec078d09834b5aa7869/raw/c8812811211dc7cd62f5b530b51b0104f39263ff/ipython%20inizialization
#import pandas as pd
#import numpy as np
%matplotlib qt4
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active April 7, 2024 12:18
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

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

@kidpixo
kidpixo / home.html
Created May 21, 2015 12:54
Social code in geekcookies
<!-- Replace subject with your message using URL Endocding: http://meyerweb.com/eric/tools/dencoder/ -->
<a href="https://mail.google.com/mail/?view=cm&amp;fs=1&amp;tf=1&amp;to=&amp;su=Vieni%20a%20vedere%20%22Episodio+6+-+Audio+in+4k%22%20su%20GeekCookies%20Podcast&amp;body=http%3A%2F%2Fgeekcookies.github.io%2Fpodcast%2F2015%2F04%2F26%2Fepisodio-6%2F" target="_blank"></a>
<a href="https://www.facebook.com/sharer/sharer.php?u=http://geekcookies.github.io/podcast/2015/04/26/episodio-6/" class="popup"></a>
<a href="http://twitter.com/home?status=Vieni%20a%20vedere%20%22Episodio+6+-+Audio+in+4k%22%20su%20GeekCookies%20Podcasti%20http%3A%2F%2Fgeekcookies.github.io%2Fpodcast%2F2015%2F04%2F26%2Fepisodio-6%2F" class="popup"></a>
<a href="http://www.reddit.com/submit?url=http://geekcookies.github.io/podcast/2015/04/26/episodio-6/"></a>
<a href="https://plus.google.com/share?url=Vieni%20a%20vedere%20%22Episodio+6+-+Audio+in+4k%22%20su%20GeekCookies%20Podcasti%20http%3A%2F%2Fgeekcookies.github.io%2Fpodcast%2F2015%2F04%2