Skip to content

Instantly share code, notes, and snippets.

View codespore's full-sized avatar
🔍
Looking for my next mission

Adrian Teh codespore

🔍
Looking for my next mission
View GitHub Profile
@codespore
codespore / hello_world.rb
Created July 9, 2019 14:59
Simple hello world page
# app/controllers/home_controller.rb
class HomeController < ApplicationController
end
# app/views/home/index.html.erb
<h1>Hello World</h1>
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
Tooltip on top
</button>
<!DOCTYPE html>
<html>
<head>
<title>Helloworld</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
@codespore
codespore / gist:cac304a22cb91cb0319dca9370a785f0
Created August 30, 2018 19:25
How to get payment flags from TOPS owner account
client = Tops::Client.new("TOPS community api key","TOPS community key")
tops_owner = client.owner("TOPS owner key")
tops_owner.Metadata.HoldCollection
tops_owner.Metadata.HoldPayment
@codespore
codespore / caliber.txt
Created July 24, 2018 16:41
Credentials to setup a Caliber community in FSC
{
"name": "Test Community - CaliberSandbox Windwalker Ranch",
"accountingPlatform": "Caliber",
"platformConnection": null,
"companyKey": "https://asp.calibersoftware.com/capi2_APISandbox/api/v2/",
"communityKey": "2",
"lastSync": "0001-01-01T00:00:00",
"apiCode": "capiDocs",
"apiLoginName": "csapi",
"apiLoginPassword": "cspwd$!",
@codespore
codespore / README-Template.md
Created July 10, 2017 19:22 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@codespore
codespore / gist:7014ebf319db3ded52bad62185f7de56
Created August 22, 2016 00:48 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

#! /usr/bin/env bash
cd '../source/'
for PHOTO in *.jpg
do
filename="$(echo $PHOTO | cut -d'.' -f 1 | sed 's/ /_/g')"
filename=`basename $filename`
convert "$PHOTO" -resize "600x600^" -gravity center -crop 600x600+0+0 +repage "../processed/$filename.jpg"
done
@codespore
codespore / entypo.css
Last active August 29, 2015 14:12 — forked from pnull/entypo.css
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@codespore
codespore / boost_template.rb
Last active May 5, 2020 03:45
Rails application template
# Rails 4 Application Template
# Usage: rails new [app_name] -m [boost_template.rb] -d postgresql
# Remove normal files we don't want
remove_file "README.rdoc"
remove_file "public/index.html"
remove_file "app/assets/images/rails.png"
# Copy database.yml to sample
inside "config" do
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key