This file contains hidden or 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 hidden or 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 |
This file contains hidden or 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
| File.open("unique.csv", "w+") { |file| file.puts File.readlines("redundant.csv").uniq } |
This file contains hidden or 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.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) |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| def ignored(name) | |
| name == "." || | |
| name == ".." || | |
| name == "names.rb" || | |
| name == "names.txt" || | |
| name == ".DS_Store" || | |
| name == ".localized" | |
| end | |
| File.open("names.txt", "w") do |names| |
This file contains hidden or 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
| 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 |
This file contains hidden or 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 UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func addFoodTruck(foodTruckOptional: Result<FoodTruck>) { | |
| switch(foodTruckOptional) { | |
| case let .Error(error): |
This file contains hidden or 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
| 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"), |
This file contains hidden or 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
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiThnl8S/uJBFX1gGFvX7neIvSojHVYeJHCE+Ok8Mr29szqwKaHajp7EjPTCSPOQtgGqZGcpPdGyvClABiGJASbfB5iFB5ULPmGw3lrO2jhxLJ/qYsBEXryT8n3OIbXEuVkVE8P5toxOYXi25Wg2HNT4nluTMQ358ITRKOWhmEW5MFgfB4beuuNXjQwVojedvxbVmlirPvLuPbdAXLQUENksWKyvwUtwMkwCm5HUHwjlmNzCtkH8gi6vQNt8UH6hVffwIS4zk+KdVnIHjy07D9xmTTYaVl4Dwi1selzgC9E1ysPnUdwcSnqBifLatdcUUH47SZmBIpI8At5o3l8/WF nick@pachulski.me |