Skip to content

Instantly share code, notes, and snippets.

View jordanhudgens's full-sized avatar

Jordan Hudgens jordanhudgens

View GitHub Profile
#!/bin/sh
echo "Running RSpec"
bundle exec rspec spec
spec=$?
if [ "$spec" = 0 ]
then
echo >&2 "Tests are green, pushing..."
exit 0
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.29",
"@fortawesome/free-solid-svg-icons": "^5.13.1",
"@fortawesome/react-fontawesome": "^0.1.11",
"ajv": "6.12.0",
"autoprefixer": "^9.1.0",
"axios": "0.19.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
module Tokenable
extend ActiveSupport::Concern
# To add to a model with pre-existing records
# ModelName.all.each do |i|
# i.token = loop do
# random_token = SecureRandom.urlsafe_base64(nil, false)
# break random_token unless i.class.exists?(token: random_token)
# end
# i.save!
begin
Net::SFTP.start(HOSTNAME, USERNAME, :password => PASSWORD) do |sftp|
sftp.file.open("products.csv", "r") do |f|
puts "Opening file..."
# Old solution:
# data = SmarterCSV.process(f, value_converters: { sku: StringConverter })
# puts "Count: #{data.size}"
# product_iterator data
# New attempt(s)
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
}
/*
##Device = Laptops, Desktops
# Create a helper lib
# e.g. lib/image_encoder.rb
module ImageEncoder
def self.call(image_data, resource_name, model)
image_data.match(/(image\/[a-z]{3,4});base64,(.*)/) do |match|
content_type = match[1]
decoded_data = Base64.decode64(match[2])
temp = Tempfile.open("image", encoding: "ascii-8bit")
temp.write(decoded_data)
alias -g subl=subl
PATH=$PATH:/usr/local/bin/; export PATH
export PATH=/usr/local/heroku/bin
# Alias' {{{
alias vi="vim"
alias zsh="vim ~/.zshrc"
alias szsh="source ~/.zshrc"
alias killtmux="tmux kill-server"
alias desk="cd ~/Desktop"
# app/models/user.rb
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
belongs_to :plan
has_one :profile
arr = np.array([1, 2, 3])
<template>
<DashboardLayout>
<div class="header">
<div>
<div class="title">
Hours Manager
</div>
</div>
</div>