Skip to content

Instantly share code, notes, and snippets.

View pachun's full-sized avatar
🎯
Focusing

Nick Pachulski pachun

🎯
Focusing
View GitHub Profile
@pachun
pachun / newc.rb
Last active July 20, 2021 21:16
Create new react native components quickly
#!/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"
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",
},
it "returns true when passed an even number" do
 even = even?(2)
 expect(even).to be(true)
end
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,
# 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'
@pachun
pachun / gist:171314491201e34589980b67ad081caa
Created November 13, 2017 20:28
Copy a Heroku Postgresql DB into a local DB
$ heroku pg:backups:capture
$ heroku pg:backups:download
Then:
$ pg_restore -c -d torq_api_development latest.dump
openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts
@pachun
pachun / random.rb
Created September 7, 2017 21:04
Generate a random string of a given length (editable character set)
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}"
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
}
/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