Skip to content

Instantly share code, notes, and snippets.

@alChaCC
alChaCC / Easyship-Simple-Oauth.md
Last active Jul 3, 2019
Easyship SImple Oauth Integration
View Easyship-Simple-Oauth.md

Purpose

To Connect your application with Easyship

Authentication

You will need to apply an administrator Easyship API token for your application.

Flows

View Easyship API - Shopmatic.md

Easyship Open API for Shopmatic

This documentation comes in addition to the main Easyship API documentation to offer additional functionality.

The API endpoints dedicated to Shopmatic can be used to create users and stores, create stores for existing users, get rates and get categories.

For any questions related to the Easyship API, please contact api-support@easyship.com

POST Create and link a new Shopmatic user

@alChaCC
alChaCC / brew-java-and-jenv.md
Last active Jul 23, 2020 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac
View brew-java-and-jenv.md

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@alChaCC
alChaCC / mp3_tags_render.rb
Last active Jun 26, 2016
mp3 tag render using Ruby
View mp3_tags_render.rb
#!/usr/bin/env ruby
require 'rubygems' # necessary for ruby v1.8.*
require 'micro-optparse'
options = Parser.new do |p|
p.option :path, 'folder location', default: 'String'
p.option :album, 'album name', default: 'String'
p.option :artist, 'artist name', default: 'String'
p.option :songuse, 'filename or tags', default: 'String'
end.process!
@alChaCC
alChaCC / MongoDB Mongoid 5.0.0.beta Teardown
Last active Aug 29, 2015 — forked from stuartmackey/MongoDB Mongoid Teardown
Teardown script to remove MongoDB collections after each test run in Rails
View MongoDB Mongoid 5.0.0.beta Teardown
teardown :clean_mongodb
def clean_mongodb
Mongoid::Clients.default.database.collections.each do |collection|
unless collection.name =~ /^system\./
collection.remove
end
end
end
View google_analytics_engagement.r
setwd("r-playground/R/ga_engagement")
list.of.packages <- c("rjson", "RCurl","RGoogleAnalytics")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
require(rjson)
require(RCurl)
require(RGoogleAnalytics)
require(ggplot2)
token <- Auth('YOUR API USER ID','YOUR API USER PASSWORD')
save(token,file="./token_file")
View bootstrap-chef-solo.sh
#!/usr/bin/env bash
# Pre-requisites
sudo apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
# Download and compile Ruby 2.1.2
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar -xvzf ruby-2.1.2.tar.gz
cd ruby-2.1.2
@alChaCC
alChaCC / sync_to_S3.cap
Created Mar 27, 2014
lib/capistrano/tasks/sync_to_S3.cap
View sync_to_S3.cap
namespace :deploy do
namespace :assets do
desc "Synchronize assets to S3"
task :sync do
on roles(:asset_syncer) do |role|
within "#{release_path}"do
with rails_env: "#{fetch(:rails_env)}" do
execute :rake, "assets:sync"
end
end
@alChaCC
alChaCC / restart.cap
Created Mar 27, 2014
lib/capistrano/tasks/restart.cap
View restart.cap
namespace :deploy do
desc "Restart passenger process"
task :restart do
on roles(:web), in: :sequence, wait: 5 do
execute "touch", "#{release_path}/tmp/restart.txt"
end
end
end
@alChaCC
alChaCC / new Staging.rb
Created Mar 27, 2014
config/deploy/staging.rb
View new Staging.rb
set :branch, 'develop'
set :user, 'stage_deployer'
set :domain, 'staging.your.domain'
set :rails_env, "staging"
set :deploy_to, "/home/#{fetch(:user)}/urbox"
set :sidekiq_pid, File.join("#{shared_path}", 'pids', 'sidekiq.pid')
set :stage, :staging
server "#{fetch(:domain)}", user: "#{fetch(:user)}", roles: %w{web app db asset_syncer sidekiqer}
You can’t perform that action at this time.