Skip to content

Instantly share code, notes, and snippets.

@ryansutc
ryansutc / PHP_IIS_Setup.md
Last active May 4, 2019 04:26
PHP on IIS Setup Checklist

***How to make sure PHP is setup correctly on your IIS Server

  1. Make sure IIS is set up & fully enabled:
   Internet Information Services > World Wide Web Services > 
    - enable Application Development Features > CGI
    - enable Common HTTP Features > Static Content
  1. Make sure PHP is installed or install it with Web Platform installer Open 'Microsoft Web Platform Installer' in Start Menu > Products > Frameworks > Windows Cache Extension vX.X
@ryansutc
ryansutc / promise_ex.js
Last active April 22, 2019 15:32
then-able javascript function example
/*
* An example of a function fetching data
* and returning a promise, making itself
* "thenable".
ref: https://scotch.io/@wesleylhandy/writing-your-own-javascript-promises
*/
function fetchIds(url) {
return new Promise((resolve, reject) => {
queryUrl = "/query?f=json&where=1%3D1&returnIdsOnly=true"
@ryansutc
ryansutc / PIP Cheatsheet.md
Last active September 13, 2022 11:47
A Quick Cheatsheet for Python PIP and pipenv Commands

Python PIP Cheatsheet


Creating/Starting a Project

get dependencies for an existing repo in your virtual env:

pipenv install
@ryansutc
ryansutc / LoadImagesAndroid.java
Created November 29, 2017 01:31
Asyncronously Load Image Icons in Android
package com.example.w0143446.movietrailerapp;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.util.Log;
@ryansutc
ryansutc / request.ts
Created November 29, 2017 01:23
Request to Web Service for Data
@Component({
templateUrl: 'freeroom-results.html',
})
export class FreeRoomResultsPage {
//public rooms: string[] = new Array();
rooms: any;
public day: Date = new Date();
icon: string;
constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http){
@ryansutc
ryansutc / RoomsAvail.sql
Created November 18, 2017 14:55
SQL Function and Procedure Calls for Room Availability
-- Get Rooms Until As a Function (REVISED, now takes time, AND SPECIFIC DATE)
DROP FUNCTION IF EXISTS RoomAvailableOnUntil;
DELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `RoomAvailableOnUntil`(roomNum VARCHAR(255),
nowTime VARCHAR(255), nowDate DATE) RETURNS time
BEGIN
DECLARE nextTime TIME;
SELECT MIN(startTime) INTO nextTime
FROM nsccSchedule
import Ember from 'ember';
const { get, set, computed } = Ember;
export default Ember.Controller.extend({
isButtonOn: false,
// begin edit area
toggle () {
var bool = this.isButtonOn ? false: true;
this.set('isButtonOn', bool);