Skip to content

Instantly share code, notes, and snippets.

@n-bar
n-bar / osx-for-hackers.sh
Created July 20, 2017 21:44 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@n-bar
n-bar / haversine.py
Created March 17, 2017 08:12 — forked from rochacbruno/haversine.py
Calculate distance between latitude longitude pairs with Python
#!/usr/bin/env python
# Haversine formula example in Python
# Author: Wayne Dyck
import math
def distance(origin, destination):
lat1, lon1 = origin
lat2, lon2 = destination
@n-bar
n-bar / README.md
Last active February 16, 2017 13:46 — forked from jgoodall/README.md
This is a sample of how to send some information to logstash via the TCP input from python.

This is a sample of how to send some information to logstash via the TCP input in python. It assumes the logstash host is on "localhost" and the TCP listening input is 5959.

The logstash.conf should look something like the sample file.

The log message should be a stringified JSON object with the log message in the @message field.

To use, run the python script python sendMessageToLogstash.js

@n-bar
n-bar / JXA Resources.md
Created November 22, 2016 20:33 — forked from JMichaelTX/JXA Resources.md
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2016-08-29 23:28 CT (Mon)

image

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

  • I like starting with the videos in the Introduction.
@n-bar
n-bar / try_distance_corr.py
Created July 17, 2016 13:24 — forked from josef-pkt/try_distance_corr.py
distance covariance and correlation
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 14:00:29 2012
Author: Josef Perktold
License: MIT, BSD-3 (for statsmodels)
http://en.wikipedia.org/wiki/Distance_correlation
Yaroslav and Satrajit on sklearn mailing list