Skip to content

Instantly share code, notes, and snippets.

angular.module('atlasApp').service('MapsService', function(
$scope,
$http,
LocationProvider,
BusInfoProvider) {
var MapsService = {};
MapsService.initMap = function() {
console.log('Initializing');
var mapOptions = {
curl -X GET \
-H "X-Parse-Application-Id: FpiNAPH6LROJqpuYHyIG7X1xgQiLcGjECxWZU2ys" \
-H "X-Parse-REST-API-Key: 6Elt7uJH5nG7U4Yc6TKUdxyDjYqfvOKUPtxw2Qbx" \
-G \
--data-urlencode 'where={"term":"201401"}' \
https://api.parse.com/1/classes/Course
curl -X GET \
-H "X-Parse-Application-Id: FpiNAPH6LROJqpuYHyIG7X1xgQiLcGjECxWZU2ys" \
-H "X-Parse-REST-API-Key: 6Elt7uJH5nG7U4Yc6TKUdxyDjYqfvOKUPtxw2Qbx" \
-G \
--data-urlencode 'where={"symbol":"DCH"}' \
https://api.parse.com/1/classes/Place
@WaseemTheDream
WaseemTheDream / set-pin.js
Created May 9, 2014 08:34
nslds.ed.gov pin selector for Chrome, Firefox, and Safari because the UI doesn't work
var setPin = function(digits) {
for (var i in digits) {
document.getElementById("yin"+i).value = digits[i];
}
};
setPin([1,2,3,4]);
function selectAllFriendsInInviteDialog() {
var people = document.getElementsByClassName('checkbox');
for (var i = 0; i < people.length; i++)
people[i].checked = true;
}
var serveryFilters = angular.module('serveryFilters', [])
serveryFilters.filter('dayofweek', function() {
return function(input) {
// Change this so that it return 'Sun' for input = 0 , 'Mon' for input = 1, .... , 'Sat' for input = 6
// Use the javascript switch statement to do this: http://www.w3schools.com/js/js_switch.asp
return input ? '\u2713' : '\u2718';
};
});
"""
Given an input node that connects to a graph, return a deep copy of the node.
"""
class Node(object):
def __init__(self, item):
self.item = item
self.neighbors = []
/// <summary>
/// Wraps the message in a data packet and delegates to the data retrieval system.
/// This command processes all messages intended for the data retrieval system.
/// </summary>
/// <typeparam name="TMessage">The message type.</typeparam>
/// <returns>True upon success.</returns>
private VisitorCmd<Boolean, String, Object, ABrokeredMessageHost> DataRetrievalCmd<TMessage>()
{
return delegate(ABrokeredMessageHost host, string idx, Object[] inps)
{
if (ModelState.IsValid)
{
// Insert a new user into the database
using (UsersContext db = new UsersContext())
{
UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower());
// Check if user already exists
if (user == null)
{
// Insert name into the profile table
import scala.io.Source
object lab1 {
def main(args: Array[String]) {
val argsInstruction = "Please provide the following 3 arguments: \n" +
"\t1. a flag t or b for top down or bottom up allocator respectively\n" +
"\t2. an integer >= 2 which specifies the number of registers to use\n" +
"\t3. an input file name"
if (args.length != 3)