This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
### | |
# Squash method based on https://stackoverflow.com/a/25357146/1202757 | |
### | |
if [ "$#" -ne 2 ]; then | |
echo "USAGE: \``basename "$0"` \"<branch to base from>\" \"<Commit message>\"\`" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Easy stream filters for, say, file read streams/pipes | |
*/ | |
const stream = require('stream') | |
class StreamFilter extends stream.Transform { | |
constructor(filterCallback) { | |
super({ | |
readableObjectMode: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { styled } from '@storybook/theming'; | |
import { storiesOf } from '@storybook/react'; | |
import { action } from '@storybook/addon-actions'; | |
import { Input, Button, Select, Textarea } from './input/input'; | |
import { Field } from './field/field'; | |
import { Spaced } from '../spaced/Spaced'; | |
const Flexed = styled.div({ display: 'flex' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Will create a tsx version of an svg file. Skips if dest exists. | |
# | |
# To run in batch, use | |
# `find src -name "*.svg" -exec ./utils/tsxify-svg.sh {} \;` | |
# or with dest dir | |
# # `find src -name "*.svg" -exec ./utils/tsxify-svg.sh {} src/components/icons \;` | |
# | |
# Note that $SED syntax is different on OSX, so install linux sed with homebrew first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleValidSubmit = async (event: any, values: {title: string; description: string; file: any}) => { | |
const {currentUser} = this.props.mobx; | |
if (this.state.loading) { | |
console.log("Submit ignored because loading."); | |
return; | |
} | |
this.setState({loading: true}); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = 'database_name'; -- specify DB name here. | |
SET @tables = CONCAT('DROP TABLE ', @tables); | |
PREPARE stmt FROM @tables; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd existing_repo | |
git remote rename origin old-origin | |
git remote add origin [email protected]:bdombro/test.git | |
git push -u origin --all | |
git push -u origin --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -q | |
<?php | |
// CUSTOM: Increase memory limit to improve likelyhood of success | |
ini_set('memory_limit','500M'); | |
/** | |
* To run this script, execute something like this: | |
* `./srdb.cli.php -h localhost -u root -n test -s "findMe" -r "replaceMe"` | |
* use the --dry-run flag to do a dry run without searching/replacing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Src: http://www.ict.griffith.edu.au/anthony/software/timeout.sh | |
# | |
# timeout [-SIG] [time] [--] command args... | |
# | |
# Run the given command until completion, but kill it if it runs too long. | |
# Specifically designed to exit immediatally (no sleep interval) and clean up | |
# nicely without messages or leaving any extra processes when finished. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: if using cloudfare, you MUST add a http redirect rule in cloudflare or | |
# cf will cache the 301 redirect for both HTTP AND HTTPS, causing an infinite 301 loop | |
# Ex rule: http://*domain.dev/* with action Always Use HTTPS | |
# Ref: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04 | |
proxy_cache_path /var/cache/nginx/aii.globalintegrity.org_proxy levels=1:2 keys_zone=aii.globalintegrity.org_proxy:10m max_size=187108864 inactive=7d use_temp_path=off; | |
server { | |
listen 80; |