Skip to content

Instantly share code, notes, and snippets.

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);
@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
@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 / 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 / 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 / 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 / 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 / material-ui-notes.md
Last active July 29, 2019 05:14
Material UI Notes

React Material UI Notes & Links

Material UI Elements:

  • : The most basic UI element. Centers content horizontally.
  • : An element that isolates/wraps css styles.
  • : allows page layout grid control on 12-column grid layout. e.g.: <Grid item xs={12} sm={6}><Paper className={classes.paper}>Test</Paper>

Material UI Properties:

item: pass the item property to components inside a container component so that they become items.

@ryansutc
ryansutc / vscode_react_setup.md
Last active January 4, 2020 22:04
How to Set up VSCode Remote Debugging with a React App

Break and Step-through App in VSCode with Chrome Dev Tools

Sometimes it's nice to be able to step through code directly in VSCode, setting breakpoints and watching variables. Here's tentatively how you can do it with our React app:

  1. Install VSCode Extension Debugger for Chrome.

  2. Add Configuration to your Launch.json as per below to launch Chrome [Source]

  3. Add argument for "runtimeArgs" as per github suggestion here to get your Redux extension running in the VSCode Chrome browser.