Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
/** | |
* ArcUtils.java | |
* | |
* Copyright (c) 2014 BioWink GmbH. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
from lxml import etree | |
import StringIO | |
import sys | |
reload(sys) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Array.prototype.splitAtEvery = (callback) -> | |
sections = [] | |
arrayClone = this.slice(0) | |
$.each(arrayClone, (idx, item) => | |
sectionsLength = 0 | |
_.each(sections, (section) => | |
sectionsLength += section.length; | |
) | |
if callback(this, idx, item) == true | |
sections.push(arrayClone.slice(0, idx+1-sectionsLength)) |
/** | |
* Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
* both of these conditions are already true. If you deployed from the IDE, however, this will | |
* save you from hundreds of power button presses and pattern swiping per day! | |
*/ | |
public static void riseAndShine(Activity activity) { | |
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
PowerManager.WakeLock lock = |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
#!/bin/bash | |
# Put this in /hooks/after_prepare/ | |
PLIST=platforms/ios/*/*-Info.plist | |
cat << EOF | | |
Add :NSAppTransportSecurity dict | |
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES | |
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSIncludesSubdomains bool YES | |
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSThirdPartyExceptionRequiresForwardSecrecy bool NO |
/** | |
* This little script copies the custom fields into the node modules directly into the keystone types. | |
* Afterwards it hooks into the keystone field types and registers the new model. | |
* | |
* ATTENTION if a model already exists it'll overwrite it. | |
* This way you can copy the fields and update them to your liking. | |
*/ | |
var _ = require('lodash'); | |
var shell = require('shelljs'); |