Skip to content

Instantly share code, notes, and snippets.

View cgrusden's full-sized avatar

Corey G cgrusden

  • Ruby on Rails, iOS, Consulting
  • 100% Remote
View GitHub Profile
@cgrusden
cgrusden / magic8-ball.svelte
Created December 27, 2020 14:19
Svelte projects
<script>
let answer = '';
let answers = [
'It is certain',
'It is decidedly so',
'Without a doubt',
'Yes – definitely',
'You may rely on it',
@cgrusden
cgrusden / heroku_env_copy.sh
Last active November 18, 2020 16:59 — forked from nabucosound/heroku_env_copy.sh
Script to copy environment variables from an existing heroku app to another one
#!/bin/bash
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
# TODO: Create list of ENV vars to send all at once instead of setting and restarting server after each
# update
set -e
sourceApp="$1"
targetApp="$2"
@cgrusden
cgrusden / moveit.sh
Created January 27, 2020 16:30
Utility Scripts
#!/bin/sh
# Rename files in subdirectories to the names of the sub directory
# and place them in the current directory
# This script needs help. but it works
for d in $1*; do
if [ -d "$d" ]; then
echo "Dir: $d"
cp $d/*.html $(echo "$d" | sed -E 's/source\/(.+)?$/source\/\1\.md/g')
@cgrusden
cgrusden / organize.sh
Last active May 9, 2019 14:36
Auto organize files into your /Downloads folder
#!/bin/sh
# About
# Our disk drives get huge because, well, files end up everywhere (or maybe you are way better at this than I am).
# Over the past 5 years my drive has bloated and there are all kinds of files everywhere.
# The first step is to ORGANIZE everything into buckets that make "sense".
# This script will move certain file types into directories. THats the first step of
# organizing as I build the script. Eventually, this script will auto run at the
# end of the day via a cronjob so all files stay organized 100% of the time
# Run this file after you split the big ass massive .vcard dump from Mac Addressbook / Contacts
# usage: ruby parser.rb > somefile.csv
class VCardParser
def initialize(path_to_file)
@file = path_to_file
end
def method_missing(name, *args, &block)
search_for_line_starting_with(name.upcase).first.to_s.split(":").last.to_s.strip.gsub(/[;,]/, "")
@cgrusden
cgrusden / today.sh
Last active January 5, 2019 14:48
Shell Script that creates a Jekyll blog post file for today and includes the current time into the front-matter
#!/bin/sh
# Jekyll, the static website generator (https://jekyllrb.com/) , requires you to create blog
# posts with the "date" in their title so they are properly sorted on the website.
# The problem is, I don't want to keep typing that shit. I want it done for me for todays date and I always
# want the time that I created this blog post to be put in the "front matter" (https://jekyllrb.com/docs/front-matter/)
# so I can see how long it's been since I started writing if I wanted.
# Usage: today.sh <the entire blog post title>
# Example: today.sh its a very magical day today
@cgrusden
cgrusden / nightwatch.json
Last active April 23, 2017 13:43
Nightwatch local development setup with Selenium Standalone server setup
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "./pages",
"globals_path" : "",
"selenium" : {
"start_process" : false,
@cgrusden
cgrusden / .gitignore
Created January 29, 2017 13:13
Sample gitignore
# Created by https://www.gitignore.io/api/rails
### Rails ###
*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
@cgrusden
cgrusden / gist:3501e2a709c3be55fa88f9c29d1918f4
Created December 23, 2016 21:18
Part 2: Biz dev for tech companies
* Imported all contacts
* We’ll want to use the Keyboard so we can label these quickly
* Settings -> Keyboard Shortcut keys ON
* Create a group to work out of, that will keep track of who has not yet been labelled incase you want to go to lunch or something
* use “X” to select the current contact
* Think about the most generic label you can apply to this person, that will apply to many, many, many others
* Scan first page to see how many people you can group into the same group
* Use the keyboard shortcut keys to navigat the current list
* Hit the “J” key to go down
* And then once we find a Contact to group into the group we’re working with, hit “X” to select that Contact
@cgrusden
cgrusden / setup github issues labels.sh
Last active July 21, 2016 22:12 — forked from rentzsch/setup github issues labels.sh
Shell script to set up a GitHub Project's Issues' Labels as described in <http://rentzsch.tumblr.com/post/252878320/my-lighthouse-ticket-settings-with-colors>.WARNING: script assumes a newish project that hasn't really used labels yet. It deletes all default labels, which means DATA LOSS if you've used them for anything.
USER=
PASS=
REPO=
ACCOUNT=sofetch
# Delete default labels
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/invalid"