Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
Some exercises from the Falsy Values workshops.
The good parts:
set :application, "simonenko.su" | |
set :node_file, "server.coffee" | |
set :host, "178.79.189.200" | |
set :repository, "git@github.com:meritt/simonenko.su.git" | |
set :user, "root" | |
set :admin_runner, "www" | |
set :scm, :git | |
set :branch, "master" | |
set :deploy_via, :remote_cache |
This document is intended to be a simplified version of the OAuth 2.0 specification. In particular it has been written with implementors in mind, and as such attempts to trim the spec down to just what you need to implement an OAuth provider or client. It is necessarily not complete, but attempts to introduce spec requirements in the same order in which the protocol proceeds in practise, with everything you need to know about each protocol endpoint brought together in one place rather than scattered across a large document.
class ChangeValidator < ActiveModel::EachValidator | |
# Enforce/prevent attribute change | |
# | |
# Example: Make attribute immutable once saved | |
# validates :attribute, change: false, on: :update | |
# | |
# Example: Force attribute change on every save | |
# validates :attribute, change: true | |
def initialize(options) |
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
⇐ back to the gist-blog at jrw.fi
Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl
. Hold onto your hats, there's some Bucket Policy acrobatics ahead.
There's also a tl;dr at the very end if you just want the delicious copy-pasta.
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
# Delete any existing NSAppTransportSecurity configurations | |
/usr/libexec/PlistBuddy -c "Delete :NSAppTransportSecurity" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
# Add the NSAppTransportSecurity dictionary again | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity dict" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains dict" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
# Add s3.amazonaws.com NSExceptionRequiresForwardSecrecy and set it to false | |
# This is a requirement of the Carnival.io SDK | |
/usr/libexec/PlistBuddy -c "Add :NSAppTransportSecurity:NSExceptionDomains:s3.amazonaws.com dict" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
// To run: | |
// clang core-audio-sine-wave.c -framework AudioUnit && ./a.out | |
#include <AudioUnit/AudioUnit.h> | |
#define SAMPLE_RATE 48000 | |
#define TONE_FREQUENCY 440 | |
#define M_TAU 2.0 * M_PI | |
OSStatus RenderSineWave( | |
void *inRefCon, |
import React, { PropTypes, Component } from 'react' | |
import { | |
Animated, | |
ScrollView, | |
Text, | |
View, | |
} from 'react-native' | |
import EStyleSheet from 'react-native-extended-stylesheet' | |
const styles = EStyleSheet.create({ |