Skip to content

Instantly share code, notes, and snippets.

View abhisuri97's full-sized avatar

Abhinav Suri abhisuri97

  • University of California Los Angeles, David Geffen School of Medicine
  • Los Angeles
View GitHub Profile
@abhisuri97
abhisuri97 / lecture1.md
Created January 11, 2018 07:44
Weird world of js types

Weird world of JS Types

Types:

  1. Numbers 1, 2, 3, 1.28, Nan, Infinity (primitive)
  2. Strings 'xyz' (primitive)
  3. Boolean true, false (primitive)
  4. Objects {course: 'CIS 197', title: 'JavaScript'}
  5. Array [1, 2, 'hi', 'there']
@abhisuri97
abhisuri97 / html
Created December 2, 2017 21:49
clubs
<tbody>
{% for a in club.answers | sort(attribute='id') %}
<td>{{ a.answer }}</td>
<td>{{ a.rating }}</td>
<td>{{ a.question.content }}</td>
{% if current_user.is_admin() %}
<td onclick="window.location.href = '{{ url_for('question.delete_answer', answer_id=a.id) }}';">
<a>Delete Answer</a></td> {% endif %}
</tr>
{% endfor %}
var lv = new PruneClusterForLeaflet(160);
mymap.addLayer(lv); // mymap is a leaflet map
/* google location history puts all lat and long pts in integers
* need to convert to regular coors
*/
var SCALAR_E7 = 0.0000001;
var os = oboe()
os.node('locations.*', function(location) {
var lv = new PruneClusterForLeaflet(160);
mymap.addLayer(lv); // mymap is a leaflet map
var os = oboe()
os.node('locations.*', function(location) {
var marker = new PruneCluster.Marker(location.latitudeE7 * SCALAR_E7,
location.longitudeE7 * SCALAR_E7);
lv.RegisterMarker(marker);
return oboe.drop;
}).done('done');
var mymap = L.map('mapid', {
scrollWheelZoom: false,
zoomControl: false
}).setView([39.9526, - 75.163], 3);
L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/256/{z}/{x}/{y}@2x?access_token=hithereyouthoughtyoucouldgetanaccesstoken', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap<\/a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA<\/a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox<\/a>',
}).addTo(mymap);
L.control.zoom({
function parseFile(file, oboeInstance) {
var fileSize = file.size;
var chunkSize = 512 * 1024; // 512 kb
var offset = 0;
var self = this; // we need a reference to the current object
var chunkReaderBlock = null;
var readEventHandler = function(evt) {
if (evt.target.error == null) {
offset += evt.target.result.length;
var chunk = evt.target.result;
var os = oboe()
os.node('locations.*', function(location) {
// process things here later
return oboe.drop;
}).done('done');
using UnityEngine;
using System.Collections;
using SocketIO;
using System;
using System.Linq;
using System.Collections.Generic;
[RequireComponent (typeof (AudioSource))]
public class Test : MonoBehaviour {
// Use this for initialization
{
id: "skeleton"
rotate: "+/- 180"
zoom: "in OR out"
x: "move-left/right"
y: "move-forward/back"
z: "move-up/down"
rotate-rate: ""
},
{
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
[RequireComponent (typeof (AudioSource))]