Skip to content

Instantly share code, notes, and snippets.

View pillows's full-sized avatar
😎
Making pancakes

Matthew Wong pillows

😎
Making pancakes
  • Skyslope
  • New York City
View GitHub Profile
@pillows
pillows / keybase.md
Created March 6, 2020 23:26
keybase.md

Keybase proof

I hereby claim:

  • I am pillows on github.
  • I am mattsupichu (https://keybase.io/mattsupichu) on keybase.
  • I have a public key whose fingerprint is 800F 665A 4463 511F FBA8 E5F1 BF32 ACCA 32EF 335D

To claim this, I am signing this object:

class Campus extends Sequelize.Model {}
Campus.init({
name:{
type:Sequelize.STRING,
allowNull: false,
notEmpty: true
},
imageUrl:{
type:Sequelize.STRING,
Student.findOne({
where:{id:studentId},
include:[Campus]
}).then((student) => {
console.log(student)
student.update({
campusId:campusId
})
res.status(200).json({status:"success"});
@pillows
pillows / 2x.js
Created May 30, 2019 02:41
TTP Javascript Recreating Prototype Assignment
var array1 = ["Apple", "Orange", "Pear", "Lemon"]
let myEach = (array, callback) => {
for(let i = 0; i < array.length; i++){
callback(array[i])
}
}
[home ~/www/sms.scribbl.es/public_html] pip freeze | grep twilio
twilio==6.7.1
[home ~/www/sms.scribbl.es/public_html] python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from twilio import twiml
>>> twiml.Reponse()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>

(25%) Suppose input data about [simplified] New York street lights has the following fields in order: avenue, street, timeR, timeG, timeY. All the fields are integers, and the time fields indicate the number of seconds the light stays each color. Write a code fragment that reads the data from keyboard input (no prompting needed), and outputs the 2 largest green light delays on avenue a. You may assume:

  • The avenua a has been initialized to some legal avenue
  • There are no errors in input (though the input will contain data for all avenues)
  • The times are distinct (i.e., no two times are the same)
  • The cin returns false when there is no more data
@pillows
pillows / gist:41254044e1b5d067c43b
Created January 23, 2016 07:31
New flask install
sudo apt-get install python python-dev mysql-server python-pip libmysqlclient-dev vim
pip install flask
pip install mysql-python
$(".url-check").bind("propertychange change click keyup input paste",function() {
var url = $("url-check").val();
var resp = {"url":url};
console.log(url);
console.log(resp);
var response = $.ajax({
type: "POST",
url: '/api/v1/verify',
data: resp,
### Keybase proof
I hereby claim:
* I am pillows on github.
* I am pillows (https://keybase.io/pillows) on keybase.
* I have a public key whose fingerprint is 6DB6 A272 3BCA B01F 5EBA 3E67 688C 8768 2377 516B
To claim this, I am signing this object:
@pillows
pillows / gist:5571873
Created May 13, 2013 21:58
Submitter.
import socket
import multiprocessing
import string
import random
import json
import hashlib
import sys
from hashlib import sha512
import time