brew update
brew install pyenv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Dexie from 'dexie'; | |
| import citiesJson from './cities.json'; | |
| const delay = () => | |
| new Promise(resolve => { | |
| setTimeout(() => { | |
| resolve(''); | |
| }, 1000); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| from StringIO import StringIO | |
| from django.http import StreamingHttpResponse | |
| class StreamCSV(object): | |
| def __init__(self): | |
| self._buffer = StringIO() | |
| self._writer = csv.writer(self._buffer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Table = React.createClass({ | |
| render: function render() { | |
| var _self = this; | |
| var thead = React.DOM.thead({}, | |
| React.DOM.tr({}, | |
| this.props.cols.map(function (col) { | |
| return React.DOM.th({}, col); | |
| }))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core.cache import cache as core_cache | |
| ''' | |
| refer: | |
| http://stackoverflow.com/questions/20146741/django-per-user-view-caching | |
| https://djangosnippets.org/snippets/2524/ | |
| ''' | |
| def cache_key(request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| import UserDetails from './UserDetails' | |
| /** | |
| * This utility function allows function calls to be debounced. | |
| * @param {Function} func Function that requires debouncing | |
| * @param {Number} wait Wait time in milliseconds between successive invocations | |
| */ | |
| const debounce = (func, wait) => { | |
| let timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var keys = []; | |
| var controlAlt = [ 'ctrl', 'alt' ]; | |
| var margin = 0; | |
| var increment = 0.1 | |
| function log() { | |
| Phoenix.log(JSON.stringify(arguments[0], true, 2)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Question 1 | |
| function incorrectChars( input, output) { | |
| const inputString = input.toLowerCase(); | |
| const outputString = output.toLowerCase(); | |
| const multiple = outputString.length / inputString.length; | |
| let incorrect = 0; | |
| for ( let i = 0; i < outputString.length - inputString.length; i + inputString.length ) { | |
| const outputSubString = outputString.substring(i, i+inputString.length); | |
| console.log('outputSubString: ' + outputSubString) |