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
#include <unistd.h> | |
#include <CoreServices/CoreServices.h> | |
#include <ApplicationServices/ApplicationServices.h> | |
typedef int CGSConnection; | |
extern OSStatus CGSGetWorkspace(const CGSConnection cid, int *workspace); | |
extern OSStatus CGSSetWorkspace(const CGSConnection cid, int workspace); | |
extern CGSConnection _CGSDefaultConnection(void); | |
int get_space_id(void); |
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
tell application "BBEdit" to set theFile to file of document 1 | |
tell application "Finder" to set theFolder to (container of file theFile) as alias | |
set theUnixPath to POSIX path of theFolder | |
tell application "iTerm" | |
tell current session of current terminal | |
write text "pushd \"" & theUnixPath & "\"" | |
end tell | |
activate | |
end tell |
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 fabric.api import * | |
from fabric.contrib.console import confirm | |
from local_settings import remote_user | |
from time import time | |
import subprocess, shlex, atexit, time | |
from settings import DATABASES | |
from os import remove | |
env.use_ssh_config = True | |
env.context = 'local' |
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
#!/bin/bash | |
# Set credentials for BigML and for the US Census | |
BIGML_USERNAME=bigml | |
BIGML_API_KEY=**** | |
CENSUS_API_KEY=**** | |
BIGML_AUTH="username=$BIGML_USERNAME;api_key=$BIGML_API_KEY" | |
# Download demographic data into files. Have to do it this way | |
# because the census API doesn't seem to allow returns of more |
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 Vagrant | |
module Provisioners | |
class Fabric < Base | |
class Config < Vagrant::Config::Base | |
attr_accessor :fabfile_path | |
attr_accessor :fabric_path | |
attr_accessor :python_path | |
attr_writer :tasks | |
def _default_fabfile_path |
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
-- Find the note in omnifocus for the current project / folder | |
-- (or create a new one) and display it. | |
-- Created by Mark Fowler (mark@twoshortplanks.com) | |
-- Help from http://veritrope.com/code/search-evernote-for-notes-containing-link-to-selected-omnifocus-item/ | |
-- on getting the name / url for the current omnifocus item | |
tell front window of application "OmniFocus" | |
try |
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 pandas import DataFrame | |
>>> from sklearn.feature_extraction.text import CountVectorizer | |
>>> docs = ["You can catch more flies with honey than you can with vinegar.", | |
... "You can lead a horse to water, but you can't make him drink."] | |
>>> vect = CountVectorizer(min_df=0., max_df=1.0) | |
>>> X = vect.fit_transform(docs) | |
>>> print(DataFrame(X.A, columns=vect.get_feature_names()).to_string()) | |
but can catch drink flies him honey horse lead make more than to vinegar water with you | |
0 0 2 1 0 1 0 1 0 0 0 1 1 0 1 0 2 2 | |
1 1 2 0 1 0 1 0 1 1 1 0 0 1 0 1 0 2 |
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
python ../nbconvert/nbconvert.py -f reveal reveal-test.ipynb | |
reveal-test_slides.html |
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 | |
""" | |
Sample call: | |
python synapse_galaxy_sync.py <api_key> <api_url> syn12345 | |
NOTE: The upload method used requires the data library filesystem upload allow_library_path_paste | |
""" | |
import os | |
import shutil |
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
xcode-select --install | |
if [ ! -x /opt/homebrew/bin/brew ]; then | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
fi | |
brew tap 'homebrew/bundle' | |
brew tap 'homebrew/services' | |
brew install automake clang-format cmake icu4c libressl libxml2 openssl pkg-config readline sqlite yajl |
OlderNewer