Skip to content

Instantly share code, notes, and snippets.

I prefer this

var distance = metersToNauticalMiles(
  utils.getDistance(
    utils.toPoint(coordinates.get(0)),
    utils.toPoint(coordinates.get(1))
  )
);
@adrianpike
adrianpike / archive.scpt
Created March 26, 2015 17:51
Outlook Archived
-- Put this into your Outlook scripts folder (~/Library/Application Support/Microsoft/Office/Outlook Script Menu Items/)
on run {}
tell application "Microsoft Outlook"
set msgs to current messages
if ((count of msgs) < 1) then return
set mailFolders to mail folders
repeat with fld in mailFolders
if (name of fld is "Archived") then
$ sudo su
# apt-get install postgresql
# su postgres
$ createuser -P -s -e developer
Enter password for new role: <PASSWORD>
And now you're ready to set up your project on postgres...
@megalithic
megalithic / radiant
Last active October 25, 2015 21:17
Radiant Player "now playing" applescript; for use with tmux or other CLI applications
#!/usr/bin/env sh
NOW_PLAYING=$(osascript <<EOF
if app_is_running("Radiant Player") then
tell application "Radiant Player"
set artist to current song artist
set track to current song name
set state to player state
if state is 1 then

Using bitlbee with HipChat

Initial setup

  • account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
@nathansmith
nathansmith / [1] flag_linkedin_recruiters.js
Last active January 28, 2016 20:07
This function can be used to pre-check (for removal) all recruiters in your LinkedIn connections list.
/*
This function can be used to pre-check (for removal)
all recruiters in your LinkedIn connections list.
It excludes recruiters that are also colleagues, so
you don't accidentally get any false positivies.
It doesn't actually do any deletion, just makes the
connections list focused solely on recruiters. The
deletion itself is up to you.
" Workspace Setup
" ----------------
function! DefaultWorkspace()
" Rough num columns to decide between laptop and big monitor screens
let numcol = 2
if winwidth(0) >= 220
let numcol = 3
endif
if numcol == 3
/**
* MQTT Bridge
*
* Authors
* - st.john.johnson@gmail.com
* - jeremiah.wuenschel@gmail.com
* - asher.friedman@gmail.com
*
* Copyright 2016
*
@luan
luan / shell-colors-vim-hybrid.sh
Last active May 26, 2016 12:13
Non-intrusive setting for shell colors that works with vim-hybrid out of the box.
#!/bin/sh
# Shell colors for vim-hybrid - Shell color setup script
# Luan Santos (http://luansantos.com)
if [ "${TERM%%-*}" = 'linux' ]; then
# This script doesn't support linux console (use 'vconsole' template instead)
return 2>/dev/null || exit 0
fi
color017="00/00/5f"
@megalithic
megalithic / setup.md
Last active June 18, 2016 11:42
AKiTiO Thunder2 & EVGA 960 GTX SC setup