Skip to content

Instantly share code, notes, and snippets.

@pathologicalhandwaving
pathologicalhandwaving / Dropbox File Picker.py
Created October 17, 2015 03:04 — forked from omz/Dropbox File Picker.py
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@pathologicalhandwaving
pathologicalhandwaving / random_LSFR.cpp
Created October 17, 2015 03:05 — forked from tomkaith13/random_LSFR.cpp
Linear Feedback Shift Register Based uniform random number generator ... it generates 2**32 -1 random numbers
#include<iostream>
using namespace std;
int rand_gen(unsigned int x) {
/*
XOR Linear feedback shift register based random gen
*/
unsigned int a=1;
@pathologicalhandwaving
pathologicalhandwaving / wiki_description.rb
Last active November 23, 2021 15:40 — forked from bshyong/wiki_description.rb
Quick scraper to fetch first paragraph of Wikipedia for a list of topics
require 'open-uri'
require 'nokogiri'
require 'csv'
require 'cgi'
# BASE_URL = 'http://en.wikipedia.org/w/api.php?format=json&action=query&prop=revisions&rvprop=content&titles='
BASE_URL = 'http://en.wikipedia.org/wiki/'
while($input_filename.nil?)
puts "Enter input filename (should be a CSV)"
@pathologicalhandwaving
pathologicalhandwaving / software_for_scientists.md
Created October 17, 2015 03:05 — forked from stared/software_for_scientists.md
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@pathologicalhandwaving
pathologicalhandwaving / Add as new Reminder.scpt
Created October 17, 2015 03:07 — forked from oliveratgithub/Add as new Reminder.scpt
Add selected Text as new Reminder in Reminders.app
on run {input, parameters}
-- This code comes from http://raduner.ch/blog/
-- To be used with an Automator Service
-- ------------------------------------------------
set inputText to input as string
tell application "Reminders"
set newremin to make new reminder
set name of newremin to inputText
end tell
@pathologicalhandwaving
pathologicalhandwaving / local_weather_textexp.py
Created October 17, 2015 03:09 — forked from lmergner/local_weather_textexp.py
TextExpander snippet for printing current weather conditions to www.DailyMile.com workouts. Requires wunderground.com api key.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Local Weather TextExpander Snippet
==================================
Quickly enter local weather conditions, specifically current temp
in www.dailymile.com workouts. This is useful for tracking
performance against temperature more closely than dailymile.com
currently allows with their pictures.
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
# Posted at http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
# Script Name: Import Pythonista Script from Bookmarklet
# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
# I got help from here: http://www.macstories.net/tutorials/from-instapaper-and-pythonista-to-dropbox-and-evernote-as-pdf/
import sys
import urllib2
import editor
(*
http://blog.smilesoftware.com/category/user-tips/textexpander/
Here are a couple of sample scripts to get you started. The first one creates a new group and then creates two snippets within it:
*)
tell application “TextExpander”
–– create a new group
make new group with properties {name:”My New Script Group”}
set newGroup to the result