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 ruby | |
require "fileutils" | |
def component_template(component_name) | |
<<~COMPONENT_TEMPLATE | |
import React from "react" | |
import { View } from "react-native" | |
import styles from "./styles" |
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 Grid from "@material-ui/core/Grid" | |
import Typography from "@material-ui/core/Typography" | |
import Link from "@material-ui/core/Link" | |
const things = [ | |
{ | |
name: "A Knight's Tale", | |
type: "Movie", | |
}, |
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
it "returns true when passed an even number" do | |
even = even?(2) | |
expect(even).to be(true) | |
end |
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 * as React from "react" | |
import { View, StyleSheet, Animated } from "react-native" | |
const styles = StyleSheet.create({ | |
imageOverlay: { | |
position: "absolute", | |
left: 0, | |
right: 0, | |
bottom: 0, | |
top: 0, |
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
# node/react-native typescript require conflict: | |
# https://gist.github.com/rawrmaan/be47e71bd0df3f7493ead6cefd6b400c | |
#!/usr/bin/env bash | |
ed -s ./node_modules/@types/react-native/index.d.ts <<< $',s/declare global/declare namespace FuckGlobals/g\nw' |
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
$ heroku pg:backups:capture | |
$ heroku pg:backups:download | |
Then: | |
$ pg_restore -c -d torq_api_development latest.dump |
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
openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts |
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
if ARGV[0].to_i == 0 || ARGV[0].to_i == nil | |
puts "usage: ruby random.rb [random string length (integer)]" | |
return -1 | |
end | |
o = [('a'..'z'), ('A'..'Z'), (1...9), ('!'..'/')].map(&:to_a).flatten | |
string = (0...ARGV[0].to_i).map { o[rand(o.length)] }.join | |
puts "random: #{string}" |
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
const ForgotPasswordView = (props) => { | |
var showMessage = false | |
const handleSubmit = (form) => { | |
const { dispatch } = props | |
dispatch(resetPassword(form.email)) | |
// this does not trigger a re-rendering because it's not state. | |
showMessage = 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
/Applications/Postgres.app/Contents/Versions/9.6/bin/pg_dump gladlydo_development > ~/Desktop/dump | |
bundle exec rake db:drop | |
bundle exec rake db:create | |
/Applications/Postgres.app/Contents/Versions/9.6/bin/psql -f ~/Desktop/dump -d gladlydo_development |