Skip to content

Instantly share code, notes, and snippets.

@turadg
turadg / bluetooth-swap.sh
Last active December 22, 2015 20:59 — forked from hughsaunders/release_bt_keyboard.sh
Script to swap your Bluetooth devices connections between two Macs. Works great with iMacMonitor.app to quickly switch your iMac between being a laptop monitor or full computer. http://bogner.sh/2013/07/os-x-how-to-use-an-imac-as-monitor/
#!/usr/bin/env bash
# This script works after you've paired the Bluetooth devices with
# both the local and remote computer. Turning one off and the other on
# forces the devices to reconnect with the only computer that has BT on.
# Look up local SSH hosts with Bonjour using `dns-sd -B _ssh`
# You may want to set up an SSH keypair to log in without typing a password
REMOTE=Stone.local
@turadg
turadg / resolv.conf
Last active October 29, 2022 22:53
# Hard-code DNS resolver to Google's servers
#
# *Setup*
# # download this file while DNS is working
# curl https://gist.github.com/turadg/7876784/raw --output ~/google-resolv.conf
# # replace your old DNS resolver
# sudo cp /etc/resolv.conf /etc/resolv.conf.auto && sudo mv ~/google-resolv.conf /etc/resolv.conf
# # make it uneditable so Vagrant doesn't clobber it
# sudo chattr +i /etc/resolv.conf
@turadg
turadg / designer.html
Created July 28, 2014 11:26
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
@turadg
turadg / README.md
Created April 1, 2015 16:01
Retracked draft

Retracked wraps your event recording system in an API optimized for React components.

Usage

Setup

Somewhere early in execution:

# set the recording function
retracked.setup(myTrackingSystem.push);
/**
* The router runs this navigate action once a new route is resolved.
* This returns a promise that must be satisfied before the render
* starts. The promise consists of all actions that each handler
* in the route declares that it needs before navigating.
*
* WHEN we upgrade react-router to 1.0, we should revisit this design
* https://github.com/rackt/react-router/pull/1158
*
* @return {Promise} to satisfy all the dependencies of the route

Keybase proof

I hereby claim:

  • I am turadg on github.
  • I am turadg (https://keybase.io/turadg) on keybase.
  • I have a public key whose fingerprint is 1AAF D87D B5DB 6B87 29A5 7646 0249 C9F5 1B7F 02C2

To claim this, I am signing this object:

#!/bin/bash
# fork of https://codecov.io/bash
set -e +o pipefail
VERSION="0db33a1"
url="https://codecov.io"
url_o=""
verbose="0"
#!/bin/bash
#
# Retroflow
#
# This makes it easier to retrofit Flow type checking onto your existing code.
#
# Given a path argument, it finds all the js/jsx files under that path that
# don't have the Flow (flowtype.org) preamble. It then adds it and runs the
# Flow check. If anything fails, it removes it again.
#
@turadg
turadg / swaggerTable.js
Created January 3, 2017 22:50
Generate a tab delimited table of endpoints on a Swagger-described API
#!/usr/bin/env node
/*
For Swagger 1.2 docs format.
Hardcode the base path in the urlFor() function.
Assumes Node 6+.
*/
@turadg
turadg / generateFlowModuleNameMappers.js
Last active June 20, 2018 06:28
Helper to create .flowconfig module name mapper
#!/usr/bin/env node
/**
* Flowtype understands Node (or Haste) imports but not Webpack.
*
* Many codebases have webpack set up like:
* src/foo.js
* src/components/Bar.jsx
*
* And then import them like `require('foo')` or `require/components/Bar.jsx`
*