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
// ==UserScript== | |
// @name Add Obsidian Links in Amazing Marvin | |
// @namespace https:/217castle.com | |
// @updateURL https://gist.githubusercontent.com/muness/3741bfa2afa5e58d38a420c50cefaa38/raw/am-obsidian.user.js | |
// @downloadURL https://gist.githubusercontent.com/muness/3741bfa2afa5e58d38a420c50cefaa38/raw/am-obsidian.user.js | |
// @version 0.1.3 | |
// @author Muness Castle | |
// @description In Amazing Marvin, this script finds Wiki links and adds links to Obsidian | |
// @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js | |
// @match https://app.amazingmarvin.com/* |
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
// global vars that are taken from userProperties | |
var BAMBOOHR_SUBDOMAIN = '<fill this out>'; | |
// add a custom menu to enter API credentials, so they don't need to be saved on the script | |
function onOpen() { | |
// Add API credentials menu to sheet | |
SpreadsheetApp.getUi() | |
.createMenu("BambooHR API Credentials") | |
.addItem("Set Credentials", "setCred") | |
.addItem("Remove Credentials", "deleteCred") |
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
CREATE LIBRARY sqlparse LANGUAGE plpythonu FROM 's3://zapier-data-packages/sqlparse.zip' CREDENTIALS 'aws_access_key_id=AKIA6P3ALSQUD7YBV6UK ;aws_secret_access_key=6FzdA0ldVGRuuBqovXpYPZsBLfZN9QAQ8eQbxaK5'; | |
DROP FUNCTION sqlparse_test(ANYELEMENT); | |
CREATE OR REPLACE FUNCTION sqlparse_test(sql_string ANYELEMENT) RETURNS varchar | |
IMMUTABLE | |
language plpythonu | |
AS | |
$$ | |
import sqlparse | |
return (sqlparse.parse(sql_string)[0]).value |
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 | |
# Based on: http://crunchbang.org/forums/viewtopic.php?id=38748#p414992 | |
# m4bronto | |
# Metadata looks like this: | |
# Chapter #0:0: start 0.000000, end 1290.013333 | |
# first _ _ start _ end | |
while [ $# -gt 0 ]; do |
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
-- Potentially quirky when it comes to week numbers. | |
BEGIN TRANSACTION; | |
DROP TABLE IF EXISTS numbers_small; | |
CREATE TABLE numbers_small ( | |
number SMALLINT NOT NULL | |
) DISTSTYLE ALL SORTKEY (number | |
); | |
INSERT INTO numbers_small VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); |
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/sh -ex | |
# This script will migrate schema and data from a SQLite3 database to PostgreSQL. | |
# Schema translation based on http://stackoverflow.com/a/4581921/1303625. | |
# Some column types are not handled (e.g blobs). | |
SQLITE_DB_PATH=$1 | |
PG_DB_NAME=$2 | |
PG_USER_NAME=$3 |
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
curl --silent https://itunes.apple.com/search?entity=macSoftware\&term=$1\&attribute=allTrackTerm | jq '.results | .[] | {id: .trackId, name: .trackName, description: .description}' |
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
### Keybase proof | |
I hereby claim: | |
* I am muness on github. | |
* I am muness (https://keybase.io/muness) on keybase. | |
* I have a public key whose fingerprint is F608 BC76 3CA2 D09D 4EAA 938D F04C 61AE 128A AB1D | |
To claim this, I am signing this object: |
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/python | |
# Based on https://plus.google.com/+TonyScelfo/posts/LvuRq9mToR1 | |
import csv | |
in_file = open('in.csv', 'rb') | |
out_file = open('out.csv', 'wb') | |
reader = csv.reader(in_file, delimiter=',', quotechar='"') | |
writer = csv.writer(out_file, delimiter=',', quotechar='"') |
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
xml_out.Trips do | |
for page in (1..pages) | |
past_trips = t.list.trip({'past' => 'true', 'include_objects' => 'false', 'traveler' => 'true', "page_size" => "30", "page_num" => page}) | |
node = Nokogiri::XML(past_trips.to_xml.to_s) | |
xml_out << node.xpath("//Trip").to_xml | |
end | |
end |
NewerOlder