Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / dman.sh
Created March 5, 2013 15:36
get the man page as dash documentation
#!/bin/bash
if [ "$1" ]
then
eval "open dash://man:"$1
else
echo "No argument supplied!!"
fi
@kidpixo
kidpixo / postgresql90.md
Created May 21, 2013 09:56
PostgreSQL 9.0 cheatsheet from www.postgresonline.com
@kidpixo
kidpixo / isis3Startup.sh
Last active December 17, 2015 14:49
[ISIS3](1) Startup file for the [fish shell](2), a command line shell for the 90s. Remember to use " set -xg $ISISROOT" in your configuration file to set is as global! [1] : http://fishshell.com/ [2] : http://isis.astrogeology.usgs.gov/
#!/opt/local/bin/fish
################################################################################
# This file should be sourced within your current shell using the ". "
# command. Since this is only a beta version we do not suggest you add this
# command to your startup file
#
# On the command line type:
# > setenv ISISROOT ????
# > cd $ISISROOT
# > . isis3Startup.csh
@kidpixo
kidpixo / PostGIS 2.0 Cheatsheet.md
Last active February 3, 2024 23:56
PostGIS 2.0 Cheatsheet
@kidpixo
kidpixo / svn.md
Created June 3, 2013 16:05
Subversion Cheatsheet in Multimardkdown
Missing from the descriptio on http://www.ni.com/white-paper/5696/en : TDMS File Format Internal Structure
The string fields have N_VALUES*32 bits / 4 bytes filed before the data pointing to each string value, starting at the end of the address field
## Example
file : XXXXX.tdms
Start : 6221213 / 5EED9D
Channel: /'TM_SCIENCE_TIS_DATA'/'par_tis_bin_mode_txt:2'
RAW_DATA_DESCRIPTOR :
@kidpixo
kidpixo / new_gist_file.sql
Created October 24, 2013 09:08
amazza che mazzasql
WITH p AS (
SELECT *
FROM (SELECT array_agg(id_meas) AS arr_id_meas,id_poly FROM user_polygons_vertex_intersection GROUP BY id_poly ORDER BY COUNT(id_meas) ASC LIMIT 2 OFFSET 500) up_in
INNER JOIN user_polygons up ON up_in.id_poly=up.polygon_id
WHERE view_short_name='global_grid_1dpp'
)
SELECT COUNT(m.id_meas),p.id_poly,trim(first(p.polygon_name)) AS polygon_name,ST_AsText(first(p.polygon))
FROM vir_point_data m,p
WHERE m.id_meas = ANY (p.arr_id_meas)
GROUP BY p.id_poly;
@kidpixo
kidpixo / my_xkdc_plot.py
Created October 24, 2013 12:03
my_xkdc_plot
import matplotlib.pyplot as plt
import numpy as np
x = np.array([2.,200.,2000.,20000.,200000.,2000000.,20000000.,24973866.])
y = np.array([11213.989,11419.187,13149.363,73087.506,231421.730,208442.174,211770.931,207008.041])
plt.xkcd() # Yes...
plt.plot(np.log(x)/np.log(10), y/(1000*60), 'r', np.log(x)/np.log(10), y/(1000*60), 'ro')
# plt.plot(x, y/(1000*60), 'r', x, y/(1000*60), 'bo')
@kidpixo
kidpixo / nvalt log
Created November 13, 2013 10:36
nvALT 111 Simplenote sync is stuck, I deleted all the note in Simplenote and try to add all my local note back on the website, no luck. The webapp Simplenote stay empty, nvalt is not sending any note! See issue report > https://github.com/ttscoff/nv/issues/212
$ /A/n/C/MacOS> ./nvALT
2013-11-13 11:25:11.139 nvALT[48732:707] load time: 0.059869,
2013-11-13 11:25:11.143 nvALT[48732:707] finished: '/var/folders/zz/mbz2k61d1d14rb4p3zckh5680000gp/T/NVPlainTextEditingSpace'
2013-11-13 11:25:22.574 nvALT[48732:707] local: 0 added, 137 changed, 28 deleted, 0 to merge
2013-11-13 11:25:22.574 nvALT[48732:707] remote: 150 added, 15 changed, 0 deleted, 0 missing
2013-11-13 11:25:36.262 nvALT[48732:707] removing 15 notes
2013-11-13 11:25:40.535 nvALT[48732:707] Updating tags with remote values.
2013-11-13 11:25:41.065 nvALT[48732:707] Updating tags with remote values.
2013-11-13 11:25:53.736 nvALT[48732:707] *** setObjectForKey: object cannot be nil (key: systemtags)
@kidpixo
kidpixo / new_gist_file.css
Created November 17, 2013 11:54
Chrome New Tab
#main a { font-family: "Sans-serif"; }
#main a { font-size: 1.6em; }
#main a { color: #555555; }
body { background-color: #ffffff; }
#main a:hover { background-color: #e4f4ff; }
#main a:hover { color: #000000; }
#main a:hover { box-shadow: 0 0 7px #57b0ff; }
body { background-image: url(); }
body { background-image: url(); }
body { background-position: left top; }