Skip to content

Instantly share code, notes, and snippets.

View daschi's full-sized avatar

Daniela Schiano di Cola daschi

  • daschi
  • San Francisco, CA
View GitHub Profile
import React, { useEffect } from "react";
import { getFacilities, deleteFacility, saveFacility } from "../database";
import { Facilities, Facility } from "../page-multi-facility/types";
import useScenario from "../scenario-context/useScenario";
type FacilityMapping = { [key in Facility["id"]]: Facility }
export interface FacilitiesState {
loading: boolean;
@daschi
daschi / .block
Last active September 12, 2018 22:55
d3-stacked-bar-chart
license: mit
let newStuff;
export const filter = array => {
return {
with: (...functions) => {
return functions.reduce((results, filterFunction) => {
return results.filter(filterFunction);
}, array);
}
};
};
#= require jquery
#= require typehead.js
$(document).ready ->
window.typeahead.init()
window.typeahead = {
######################
# INITIALIZATION STUFF
do ->
class StateMap
constructor: ->
# Switch county boundary map based on state page
@countyBoundaries = <%= asset_path("county_boundaries/TX.geojson").inspect %>
@settings = {scrollWheelZoom: false}
@accessToken = L.mapbox.accessToken = 'pk.eyJ1IjoiZGFzY2hpIiwiYSI6IjcxOWE1Njc3OTVmMDY4NDEzYmRmMmVjNTRjMDE5MTdhIn0.1-E1xWlLuCMa3X8BRvN1Rg'
@map = new L.mapbox.map('map', 'mapbox.streets-basic', @settings)
@daschi
daschi / The Technical Interview Cheat Sheet.md
Last active September 13, 2015 02:49 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@daschi
daschi / gist:0a79e79c38f68c8026ed
Created September 12, 2015 18:50
Best Algorithm
def find_possible_series(number)
possible_series = []
split_number = number.to_s.split('')
while split_number.length > 13
split_number.map!{|i| i.to_i}.each_slice(13) do |slice|
if slice.include?(0) == false
possible_series << slice
end
end
split_number.delete_at(0)
@daschi
daschi / oojs.md
Last active August 29, 2015 14:27 — forked from user512/oojs.md
Object Oriented JavaScript

#Object Oriented Javascript

#Overview

  • Creating Objects in JavaScript
    • new Object();
    • Object Literal Notation (Important)
    • Factory Function
  • Review JavaScript's this
  • More Creating Objects in JavaScript
  • Constructor Function
@daschi
daschi / queue.rb
Created July 12, 2015 21:42
Simple Queue Class
class Queue
def initialize(max_size=nil)
@store = []
@max_size = max_size
end
def push(x)
raise "Queue Overflow - The queue is full" if self.full?
@store.push x
end