This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
# source is a variable containing a source name, such as M31, Alpha Centauri, Sag A*, etc | |
source = "Sag A*" | |
# This is the string with the URL to query the Sesame service, | |
# using a 'name' parameter. | |
# sesameQueryUrl = 'http://cdsws.u-strasbg.fr/axis/services/Sesame?' +\ | |
# 'method=sesame&resultType=p&all=true&service=NSVA' +\ | |
# '&name=%(name)s' | |
# use the updated CDS REST endpoint | |
sesameQueryUrl = 'http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/-op/NSV?%(name)s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module layout: | |
# + mymodule | |
# | | |
# +---__init__.py | |
# | | |
# +---class1.py | |
# | | |
# +---class2.py | |
# | | |
# +---otherclasses/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from sampy import * | |
import time | |
from pprint import pprint | |
# Setup hub by calling "start_samp_hub.py", it would contain: | |
# myhub = SAMPHubServer() | |
# myhub.start(True) # The True makes the script standalone; it should be called with | |
# alternatively, sampy (/usr/local/bin/sampy, for instance) can be called: | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on downloadUrl(theUrl, fileName) | |
set curlCmd to "curl -s -L -o " & fileName & " '" & theUrl & "' " | |
--display dialog curlCmd | |
do shell script curlCmd | |
end downloadUrl | |
on run {input, parameters} | |
set theUrls to {} | |
repeat with kmlFile in input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.Provider; | |
import java.security.Security; | |
import java.util.Arrays; | |
public class ShowCryptoProviders | |
{ | |
public static void main(final String[] args) | |
{ | |
final Provider[] providers = Security.getProviders(); | |
for (final Provider p : providers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
message = { | |
'title': 'Thanks to @javierarantegui’, | |
'description': 'Thank you message to Javier Arantegui (@javierarantegui) for his tip on markup.su' | |
} | |
pprint(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script only works in Mac OS X, due to the dependency | |
# on the `open` command. | |
# It can be directly added into a .profile file, either | |
# by copying and pasting its content, or sourcing the | |
# file: | |
# . search_functions.sh | |
# Usage: google any search terms | |
# Result: default browser opens with a query on any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eps2jpeg { | |
for i in $* | |
do | |
filefolder=`dirname $i` | |
filename=`basename $i` | |
tmppdf="/tmp/`uuidgen`.pdf" | |
ps2pdf $i $tmppdf | |
sips -s format jpeg $tmppdf --out "$filefolder/$filename.jpg" | |
rm $tmppdf | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash function (Mac OS X specific) for getting man pages | |
# in PDF visualized in Preview.app | |
# Tryit with `pdfman man`, `pdfman curl`, or `pdfman bash`, for instance. | |
pdfman() { | |
outname=/tmp/man-"$1".ps | |
man -t $1 > $outname # get PS version of man page in /tmp | |
if [ -s $outname ] | |
then { | |
open -a Preview $outname | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# | |
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder | |
use strict; | |
use warnings; | |
use URI::Escape qw(uri_escape_utf8); | |
use open IO => ":utf8", # UTF8 by default | |
":std"; # Apply to STDIN/STDOUT/STDERR |
OlderNewer