This file contains 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
#!/bin/sh | |
echo "Running RSpec" | |
bundle exec rspec spec | |
spec=$? | |
if [ "$spec" = 0 ] | |
then | |
echo >&2 "Tests are green, pushing..." | |
exit 0 |
This file contains 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
"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", |
This file contains 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
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! |
This file contains 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
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) |
This file contains 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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
} | |
/* | |
##Device = Laptops, Desktops |
This file contains 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
# 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) |
This file contains 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
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" |
This file contains 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
# 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 |
This file contains 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
arr = np.array([1, 2, 3]) |
This file contains 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
<template> | |
<DashboardLayout> | |
<div class="header"> | |
<div> | |
<div class="title"> | |
Hours Manager | |
</div> | |
</div> | |
</div> |