Skip to content

Instantly share code, notes, and snippets.

@mrshu
mrshu / duckpm.sh
Created February 2, 2012 21:21
node.js packages uploader to duckpan.org
#!/bin/bash
USER=duck
PASS=pass
npm_config__auth=`echo "$USER:$PASS" |base64`
npm --registry https://duckpan.org/duckpan/do/upload publish
# does PUT https://duckpan.org/duckpan/do/upload/mypackage
@mrshu
mrshu / goals.js
Created February 27, 2012 17:22 — forked from Adman/goals
missing }
var goal1 = 0;
var goal2 = 0;
window.scaling1 = 0;
window.scaling2 = 0;
function toggleOnGoal() {
btnStart = document.getElementById("btnStart");
if (btnStart.innerHTML == "Pause") {
$("#time").stopwatch().stopwatch('stop');
@mrshu
mrshu / dabblet.html
Created December 19, 2012 14:20 — forked from anonymous/dabblet.html
Untitled
<html>
<meta charset='utf-8'>
<head>
<title>GCM WebDeveloper website</title>
<link href='http://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Keania+One' rel='stylesheet' type='text/css'>
</head>
<body>
<style>
body {
@mrshu
mrshu / html5-audio.html
Created January 31, 2013 17:25
Simple example of usage of HTML5 audio tag
<!DOCTYPE html>
<html>
<head>
<script>
var player = document.getElementById("player");
player.play();
</script>
</head>
<body>
<audio id="player">
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
@mrshu
mrshu / athena_dbt.md
Last active November 28, 2018 13:24
AWS Athena `dbt` information sheet
  1. What options are there for connecting to the warehouse? Eg: ODBC, a python module, etc

  2. Is there a consensus around which of the options in #1 is the most featureful/best supported/most mature/etc option?

  • It would most probably be PyAthena, as it does not have any other non-pythonic requirements.
@mrshu
mrshu / aws_glue_python_shell_installed_packages.txt
Created February 1, 2019 09:22
AWS Glue Python Shell -- pre-installed packages
awscli==1.14.45
boto3==1.5.35
botocore==1.8.49
colorama==0.3.7
docutils==0.14
futures==3.2.0
jmespath==0.9.3
numpy==1.14.0
pandas==0.22.0
pip==9.0.1
@mrshu
mrshu / list_available_packages.py
Created February 4, 2019 15:49
Python list available packages
import pkg_resources
installed_packages = pkg_resources.working_set
for package in sorted(installed_packages, lambda x: x.key):
print "{}=={}".format(package.key, package.version)
@mrshu
mrshu / simple_athena_query.py
Last active June 20, 2019 16:35
Simple Athena Query
from airflow.models import DAG
from airflow.contrib.operators.aws_athena_operator import AWSAthenaOperator
from datetime import datetime
with DAG(dag_id='simple_athena_query',
schedule_interval=None,
start_date=datetime(2019, 5, 21)) as dag:
run_query = AWSAthenaOperator(
task_id='run_query',
@mrshu
mrshu / simple_templated_athena_query.py
Last active June 7, 2019 19:29
Simple Templated Athena Query
from airflow.models import DAG
from airflow.contrib.operators.aws_athena_operator import AWSAthenaOperator
from datetime import datetime
with DAG(dag_id='simple_athena_query',
schedule_interval=None,
start_date=datetime(2019, 5, 21)) as dag:
run_query = AWSAthenaOperator(
task_id='run_query',