Skip to content

Instantly share code, notes, and snippets.

View LayneSmith's full-sized avatar
🎯
Focusing

Layne Smith LayneSmith

🎯
Focusing
View GitHub Profile
title:Big Killer's Wish List
// Crimil's Dagger ()
dimwishlist:item=198854575&perks=3828510309,3038247973
dimwishlist:item=198854575&perks=3828510309,1015611457
dimwishlist:item=198854575&perks=880644845,3038247973
dimwishlist:item=198854575&perks=880644845,1015611457
dimwishlist:item=198854575&perks=1168162263,3038247973
dimwishlist:item=198854575&perks=1168162263,1015611457
@LayneSmith
LayneSmith / mapbox-gl.md
Last active April 4, 2019 21:08
Steps for embedding mapbox-gl in an ES6 build system

In terminal navigate to project and run npm install -S mapbox-gl

Insert import mapboxgl from 'mapbox-gl'; at top of scripts.js

In scripts.js initialize map with

// GET MAP STARTED
const map = new mapboxgl.Map({
  container: 'map', // Div ID, where to put it in DOM. <div id="map"></div> for example

style: 'https://maps.dallasnews.com/styles.json', // link to custom styles

@LayneSmith
LayneSmith / Readme.md
Last active July 31, 2017 15:39
D3.js bl.ock template

D3 template that should integrate with current production.

const csv = `transit_option,working_poor,working_nonpoor
Overall,20,20
Transit,60,40
Car,20,25
Bike,15,10
Walking,10,10`;
function convertCSVstring(csv){
const lines = csv.split("\n");
const result = [];
@LayneSmith
LayneSmith / README.md
Last active July 6, 2018 01:53 — forked from arianagiorgi/README.md
AWS Lambda Automation

Automation with AWS Lambda

Setup Python-lambda

We'll be using Python-lambda

  1. Create new directory and call it whatever you want.

  2. Enter new directory and run virtualvenv venv from Terminal. If you don't have virtualenv, you can install it with pip install virtualenv.

@LayneSmith
LayneSmith / virtualenv.md
Last active June 7, 2017 17:48 — forked from johndhancock/terminalCommands.md
Creating virtual environment in projects

In command line of directory desired:

Creating viruatl environment

virtual venv

Specifying python version upon creation

virtual venv --python=python3

Stepping into the virtual environment

source venv/bin/activate

@LayneSmith
LayneSmith / inheritance.js
Created May 3, 2017 19:47
Holding for inheritance work
// function Dog(name, breed) {
// this.name = name;
// this.breed = breed;
// }
//
// Dog.prototype.bark = function () {
// console.log(`Bark Bark! My name is ${this.name}`);
// };
// Dog.prototype.cuddle = function () {
// console.log('I love you, owner!');
@LayneSmith
LayneSmith / promises.js
Created May 3, 2017 19:45
Basic promise structure
///////////////////////////////////////////////////
// LOAD FILES FROM SONGS LIST
///////////////////////////////////////////////////
let initialFunction = function () {
return new Promise((resolve, reject) => {
console.log('%cinitialFunction....', "color: purple; font-size: 24px;");
resolve('initialFunction COMPLETE');
});
};
let function1 = function () {
# install virtualenv
pip install virtualenv
# create a virtualenv called "django-env"
# with no site packages or furniture
virtualenv --no-site-packages django-env
# activate the virtualenv
source django-env/bin/activate
@LayneSmith
LayneSmith / console.js
Created April 27, 2017 05:50
Useful console methods
// Paste any snippet into a console window to see it in action.
// You can filter all these in console, ie: just show info etc...
console.log('This is a plain log'); // Plain log
console.warn('This is a warning'); // Yellow with warning
console.error('This is an error'); // Red with warning
console.info('This is info'); // Blue with info
console.debug('This is debug'); // Plain log BUT type is also blue
// String substitution