Skip to content

Instantly share code, notes, and snippets.

View natec425's full-sized avatar
🙃
Software Developer. Educator.

Nate Clark natec425

🙃
Software Developer. Educator.
View GitHub Profile
@natec425
natec425 / populate_from_random_user.py
Created June 5, 2020 18:29
Fetching data from randomuser.me and populating a local database in Python
"""
## Overview
This script pulls random user data from randomuser.me and populates a database on my local machine.
Dependencies:
- python 3+ (I'm running 3.8)
- requests
- your required database driver (I'm using postgres so psycopg2-binary)
Useful Resources:
@natec425
natec425 / magnolia-js-2019-wc-svelte-links.md
Created April 18, 2019 15:49
Magnolia JS 2019 - Web Components & Svelte workshop links
@natec425
natec425 / web-components-workshop.md
Created March 21, 2019 01:40
Zero Dependency Components: Introduction to Web Components

Zero Dependency Components: Introduction to Web Components

As much as I love JavaScript, it’s always the most expensive part of your site.

Come learn about Web Components with friends!

Web Components are native browser APIs that let you develop rich UI components with 0KB of added bundle size! In this workshop I want to convince you that you might not need a framework.

@natec425
natec425 / seq_con_par.py
Created May 24, 2018 01:14
starting point for discussing sequential vs concurrent vs parallel
from multiprocessing import pool
from timeit import timeit
def smap(func, stuff):
return list(map(func, stuff))
def cmap(func, stuff):
with pool.ThreadPool(processes=4) as p:
@natec425
natec425 / projects.js
Created February 5, 2018 21:02
React Router Project Groups
import React, { Component } from 'react';
import { BrowserRouter as Router, Link, Route } from 'react-router-dom';
const project_groups = {
python: [
{
id: 'python-hello',
title: 'Hello World',
description: 'Hello world in python.'
}
@natec425
natec425 / Main.elm
Created June 23, 2017 17:53
Elm Filterable Stores
module Main exposing (..)
import Html exposing (Html, Attribute, beginnerProgram, select, option, table, tr, td, th, text, div)
import Html.Attributes exposing (value)
import Html.Events exposing (on, targetValue)
import Json.Decode as JD
onChange : (String -> msg) -> Attribute msg
onChange toMsg =
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo bash $0"
exit 1
fi
CODE_URL=https://az764295.vo.msecnd.net/stable/19222cdc84ce72202478ba1cec5cb557b71163de/code_1.12.2-1494422229_amd64.deb
CHROME_URL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
GITKRAKEN_URL=https://release.gitkraken.com/linux/gitkraken-amd64.deb
@natec425
natec425 / finish.sh
Created April 17, 2017 16:46
Finish installing dotnet core on ubuntu 16.10
#! /bin/bash
set -e
echo "Downloading libicu55"
curl http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.1_amd64.deb > libicu55_55.1-7ubuntu0.1_amd64.deb
echo "Installing libicu55"
sudo dpkg -i libicu55_55.1-7ubuntu0.1_amd64.deb
@natec425
natec425 / itemDecode.elm
Created October 26, 2016 15:08
Elm - Json.Decode reuse with Extensible Records
module Scratch exposing (..)
import Json.Decode exposing (..)
type alias Item a =
{ a
| field1 : String
, field2 : String
, field3 : String
@natec425
natec425 / about.html
Created August 24, 2016 17:27
raw base camp coding academy about page html
<!DOCTYPE html>
<html>
<head>
<title>About &#8211; Base Camp Coding Academy</title>
</head>
<body>
<a href="https://basecampcodingacademy.org/">
<img width="300" height="82" src="https://basecampcodingacademy.files.wordpress.com/2015/12/basecamp_weblogo_2.png?w=300&amp;h=82&amp;crop=1" />