Skip to content

Instantly share code, notes, and snippets.

View pachun's full-sized avatar

Nicholas Pachulski pachun

View GitHub Profile
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
File.open("unique.csv", "w+") { |file| file.puts File.readlines("redundant.csv").uniq }
@pachun
pachun / rsar.rb
Last active April 23, 2018 19:31
if ARGV.count != 3
puts "USAGE: ruby rsar.rb file_ext search_str replace_str"
return
end
command = "find . -type f -name '*.#{ARGV[0]}' -exec sed -i '' s/#{ARGV[1]}/#{ARGV[2]}/g {} +"
puts "running \"#{command}\""
exec(command)
@pachun
pachun / times3.rb
Created January 19, 2017 04:07
rename png images with @3x for xcode projects
folder_path = "#{Dir.pwd}/"
Dir.glob("#{folder_path}*.png").each do |file|
base_name = File.basename(file, File.extname(file))
new_name = folder_path + base_name + "@3x" + File.extname(file)
File.rename(file, new_name)
end
@pachun
pachun / names.rb
Last active January 19, 2017 03:14
iOS Sticker Pack Helper
def ignored(name)
name == "." ||
name == ".." ||
name == "names.rb" ||
name == "names.txt" ||
name == ".DS_Store" ||
name == ".localized"
end
File.open("names.txt", "w") do |names|
defmodule TruckTrackerApi.DayFilterService do
def filter(trucks, day_of_week) do
for %{day: ^day_of_week, name: n, location_description: ld, time: t} <- trucks, do: %{name: n, day: day_of_week, location_description: ld, time: t}
end
end
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func addFoodTruck(foodTruckOptional: Result<FoodTruck>) {
switch(foodTruckOptional) {
case let .Error(error):
require "rubygems"
require 'rake'
require 'yaml'
require 'time'
SOURCE = "."
CONFIG = {
'version' => "0.3.0",
'themes' => File.join(SOURCE, "_includes", "themes"),
'layouts' => File.join(SOURCE, "_layouts"),
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiThnl8S/uJBFX1gGFvX7neIvSojHVYeJHCE+Ok8Mr29szqwKaHajp7EjPTCSPOQtgGqZGcpPdGyvClABiGJASbfB5iFB5ULPmGw3lrO2jhxLJ/qYsBEXryT8n3OIbXEuVkVE8P5toxOYXi25Wg2HNT4nluTMQ358ITRKOWhmEW5MFgfB4beuuNXjQwVojedvxbVmlirPvLuPbdAXLQUENksWKyvwUtwMkwCm5HUHwjlmNzCtkH8gi6vQNt8UH6hVffwIS4zk+KdVnIHjy07D9xmTTYaVl4Dwi1selzgC9E1ysPnUdwcSnqBifLatdcUUH47SZmBIpI8At5o3l8/WF nick@pachulski.me