git format-patch -1 <sha>
OR
git format-patch -1 HEAD
git apply --stat file.patch
# show stats.
git apply --check file.patch
# check for error before applying
class PostIndex extends React.Component { | |
state = { loading: false }; | |
componentDidMount() { | |
window.onscroll = () => { | |
if (!this.state.loading | |
&& (window.innerHeight + window.scrollY) | |
>= document.body.offsetHeight) { | |
this.setState({loading: true}, () => { |
#!/bin/bash -e | |
# batch resize @3x iOS image assets to @2x and @1x | |
# copy this script to the folder where the @3x images files live and run "./resizer3x.sh" in terminal. | |
# this will generate [filename]@2x.[extension] and [filename].[extension] images in the same folder | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" |
echo ".DS_Store" >> ~/.gitignore-system | |
git config --global core.excludesfile ~/.gitignore-system |
// | |
// NSObject+Blocks.h | |
// Filemator | |
// | |
// Created by Zachary Waldowski on 4/12/11. | |
// Copyright 2011 Dizzy Technology. All rights reserved. | |
// | |
@interface NSObject (Blocks) |
var Index = React.createClass({ | |
getInitialState: function () { | |
return { | |
lastPress: 0 | |
} | |
}, | |
onPress: function () { | |
var delta = new Date().getTime() - this.state.lastPress; |
#! /bin/bash | |
# This script will export the json contents of an Azure Search instance into a JSON array. | |
# The script creates local files under the directory it is executed. The result is saved to a newly created local file. | |
# The script depends on `curl` and `jq` utilities. | |
# Arguments: $1 : azure search service name, $2: azure search index name, $3: azure search admin auth key. | |
set -e -o pipefail | |
serviceName="$1" |
UIFont.familyNames.forEach({ familyName in | |
let fontNames = UIFont.fontNames(forFamilyName: familyName) | |
print(familyName, fontNames) | |
}) |
#!/bin/bash | |
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
# | |
ARGS=2 | |
E_BADARGS=99 | |
if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
then |
env > env.txt | |
instruments -s devices > devices.txt | |
#! /bin/sh -e | |
# This script demonstrates archive and create action on frameworks and libraries | |
# Based on script by @author Boris Bielik | |
# Release dir path | |
OUTPUT_DIR_PATH="${PROJECT_DIR}/XCFramework" | |
function archivePathSimulator { |