Skip to content

Instantly share code, notes, and snippets.

View freshtonic's full-sized avatar
🎯

James Sadler freshtonic

🎯
  • Sydney, Australia
View GitHub Profile
@pat
pat / gist:6423135
Created September 3, 2013 12:15
Australian Politics Primer - September 3rd 2013

Disclaimer: as you’ve likely picked up from Twitter, I’m obviously biased. I’m not going to make much of an attempt to avoid that.

Parties, History and Houses

The Australian Federal Election is happening this Saturday. The likely outcome is that our new Prime Minister will be Tony Abbott, a conservative, bible-loving, homophobic misogynist. He’s the leader of the Liberal Party, who aren’t really very good at being liberal. Hence, in Australia, there’s the distinction between big-L Liberal and small-l liberal. The Liberal Party has an ongoing coalition with the National Party, who are also conservatives (perhaps moreso) with a focus on the bush (anywhere that isn’t a city). Together they’re known as the Coalition (yes, I know, it’s imaginative, but they save their creativity for how to best fuck over refugees, women, the poor, and generally anyone whose skin colour isn’t white).

They’re not in power at the moment though – the party running the country currently is the Australian Labor Party (a

module Primes where
open import Level using (_⊔_)
open import Coinduction
open import Function
open import Data.Empty
open import Data.Unit
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Divisibility
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@nkpart
nkpart / fuzzy_window_select.tmux.conf
Last active August 29, 2015 13:56
Selecta + Tmux
# Creates a new window to run selecta over list-windows, then selects the result.
bind-key g new-window -n "__SELECTA__" "tmux list-windows | grep -v __SELECTA__ | selecta | sed s/:.*// | xargs -I {} tmux select-window -t {}"
# The same in a split (this is probably better). 21 is how high selecta is by default, 1 line for the prompt, 20 for results
bind-key g split-window -l 21 "tmux list-windows | selecta | sed s/:.*// | xargs -I {} tmux select-window -t {}"
@JonRowe
JonRowe / pre-recieve-hook
Last active August 29, 2015 13:57
A git pre-receive hook for Ruby deploying.
#!/bin/bash
# Let's deploy...
echo "Deploying..."
echo "Deploying as: `whoami`"
# turn on failing script on any command fail
set -e
set -o pipefail
@philoye
philoye / nyc-recommendations.markdown
Last active August 29, 2015 14:06
NYC Recommendations

My NYC Recommendations

It is a bit out of date in places (I haven’t lived in NYC since 2007). Make sure you google places to make sure they are still open:

DRINKS

Sunset drinks at the Boom Boom room at the Standard Hotel. It is in the meat packing district. Overpriced cocktails but stupendous view.

@damncabbage
damncabbage / decrypt_with.py
Last active January 29, 2017 20:45
A file-decryption filter using Ansible Vault's decryption mechanism and an arbitrary password.
# Place in <your-playbook-root>/filter_plugins/decrypt_with.py
from ansible import errors
from ansible.utils.vault import VaultLib
def decrypt_with(data, password):
vault = VaultLib(password=password)
if data is None:
raise errors.AnsibleFilterError("data is missing; cannot decrypt")
elif len(data) == 0:
@jcgregorio
jcgregorio / How_to_use.html
Last active July 17, 2023 14:44
HTML Templating using the HTML <template> element and exactly 100 lines of JS. A cleaned up version of this code is now available at https://github.com/jcgregorio/stamp/.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="templating.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<template id=t>
@jimfb
jimfb / gist:0eb6e61f300a8c1b2ce7
Last active January 22, 2022 01:52
Parent vs. Owner Context

If you've reached this page, it's probably because your "parent-based and owner-based contexts differ".

As we've been iterating on React's "context" feature, we've discovered that the parent-based relationship is more useful than the owner-based relationship, so we're migrating to use a parent-based hierarchy.

In short, the owner of a component is whomever creates the component, while the parent of a component is whomever would be the containing ancestor in the DOM hierarchy. To learn more about the owner relationship, see the docs here: http://facebook.github.io/react/docs/multiple-components.html

In many cases, the owner and the parent are the same node, in which case, no further action is necessary.

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).