Skip to content

Instantly share code, notes, and snippets.

@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 [email protected]:~/
  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
//Intermediate Midterm
//Please fork this gist. Complete it, and remember to save often!
// 1. How do you make comments and why do you make them?
@kevincolten
kevincolten / whatevs.js
Created January 17, 2016 16:40
Some other file or gist :(
// Turn back now. You are not supposed to see this.
@kevincolten
kevincolten / post.md
Created January 17, 2016 16:38
#post Here's Another Post

Welcome back!

Here's another post about what technologies I love to use, or about what I ate for breakfast.

@kevincolten
kevincolten / post.md
Last active January 17, 2016 16:39
#post My First Post!

Hello World!

Welcome to my awesome blog. I'm a student at Austin Coding Academy learning how to use APIs with AJAX requests. Check out my other posts!

@kevincolten
kevincolten / simplex11vnc.sh
Created November 29, 2015 04:17
Install X11VNC on Raspberry Pi
#!/bin/bash
# https://cymplecy.wordpress.com/2014/02/09/auto-install-x11vnc/
# To install, run LX Terminal and copy and paste the following code:
# wget http://goo.gl/MbfUEp -O isx11.sh
# and then press enter to download the installer
# Once it has finished downloading, type the following and follow the instructions:
# sudo bash isx11.sh
# A very crude script to setup X11VNC inspired by MrEngmans Realtek RTL8188CUS script and based upon my autosimplesamba