Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / dman.sh
Created Mar 5, 2013
get the man page as dash documentation
View dman.sh
#!/bin/bash
if [ "$1" ]
then
eval "open dash://man:"$1
else
echo "No argument supplied!!"
fi
@kidpixo
kidpixo / postgresql90.md
Created May 21, 2013
PostgreSQL 9.0 cheatsheet from www.postgresonline.com
View postgresql90.md
@kidpixo
kidpixo / isis3Startup.sh
Last active Dec 17, 2015
[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/
View isis3Startup.sh
#!/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 / script
Created May 31, 2013
roba per le robe lí
View script
# questo é il mio file list.kMDItem
kMDItemAcquisitionMake
kMDItemAcquisitionModel
kMDItemAperture
kMDItemContentCreationDate
kMDItemFSContentChangeDate
kMDItemFSCreationDate
kMDItemDisplayName
kMDItemExposureTimeSeconds
@kidpixo
kidpixo / PostGIS 2.0 Cheatsheet.md
Last active Nov 6, 2020
PostGIS 2.0 Cheatsheet
View PostGIS 2.0 Cheatsheet.md
@kidpixo
kidpixo / svn.md
Created Jun 3, 2013
Subversion Cheatsheet in Multimardkdown
View svn.md
View TDMS File Format Internal: the missing stuff
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 Oct 24, 2013
amazza che mazzasql
View new_gist_file.sql
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;
View my_xkdc_plot.py
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 Nov 13, 2013
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
View nvalt log
$ /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)