Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / styleguide.md
Last active April 8, 2017 15:06
ACA Styleguide

ACA Styleguide - Necessary vs Sugary Syntax

Things we will look for

  • Does it stay consistent across more complex variations
  • Is it visually grep-able for errors
  • Does it translate to other targeted WebDev languages
    • Python
    • PHP
    • Ruby
  • How far is it from the ES5 implementation?
@kevincolten
kevincolten / README.md
Created February 28, 2017 21:11
React in the DOM

In your browser devtools, you can access the React component in the console with window.component

Try typing window.component.setState({ name: 'Kevin' });

@kevincolten
kevincolten / form.html
Created February 23, 2017 02:01
Iframe Post Message
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>
@kevincolten
kevincolten / git_alias.sh
Created January 13, 2017 20:17
Generate bash aliases for git repositories
for f in $(ls ~/github); do alias "$f"="cd ~/github/$f" ; done
@kevincolten
kevincolten / StripePayments.sql
Created November 12, 2016 15:52
All students and their payments
SELECT users.id, users.first_name, users.last_name, users.email, stripe_payments.customer, stripe_payments.source, CAST(SUM(stripe_payments.amount) as FLOAT) / 100
FROM users
JOIN stripe_payments as sp ON INSTR(sp.source, users.email) > 0
JOIN stripe_payments ON users.customer_id = stripe_payments.customer
WHERE stripe_payments.customer != ''
AND sp.customer = ''
GROUP BY users.email;
/* SELECT users.id, users.first_name, users.last_name, users.email, stripe_payments.customer, stripe_payments.source, CAST(SUM(stripe_payments.amount) as FLOAT) / 100
FROM users
@kevincolten
kevincolten / NonAlumni.sql
Created November 7, 2016 21:54
Campus Manager Report Queries
SELECT idn, first_name, last_name, email, phone, COUNT(users.email) as courses
FROM users
INNER JOIN registrations ON users.id = registrations.user_id
GROUP BY users.email
HAVING COUNT(users.email) < 3 AND COUNT(users.email) > 1
ORDER BY courses DESC, cast(idn as Number) ASC;
@kevincolten
kevincolten / migration.md
Last active November 1, 2016 04:22
Rocket.Chat DB Migration from Heroku/mLab to DigitalOcean

Rocket.Chat DB Migration from Heroku/mLab to DigitalOcean

  1. Put app in maintenance mode on Heroku
  2. Download backup of database in mLab
  3. Copy database to DO Droplet scp backup.tgz root@x.x.x.x:~/
  4. SSH into droplet and unzip the file tar zxvf backup.tgz
  5. Inside the unzipped directory, rename the database directory to parties/ mv backup/database-name/ backup/parties
@kevincolten
kevincolten / C#.md
Last active November 20, 2017 19:37
@post Up and running with C#
Control Prefix Example
Label lbl lblSurname
TextBox txt txtSurname
DataGrid dg dgResults
GridView gv gvResults2
Button btn btnSave
ImageButton iBtn iBtnSave
Hyperlink lnk lnkHomePage
DropDownList ddl ddlCompany