Skip to content

Instantly share code, notes, and snippets.

View naeluh's full-sized avatar
🌐
Busy

nick hulea naeluh

🌐
Busy
View GitHub Profile
@kpunith8
kpunith8 / app.js
Last active October 10, 2023 03:17
Using query and route params with useContext() Hook
import React, {useState} from 'react'
import RouteContext, {EMPTY_ROUTE} from './route-context'
const App = props => {
const [route, setRoute] = useState(EMPTY_ROUTE)
useEffect(() => {
// Logic to update the setRoute() based on the current route
// route object has params and query keys, update them accordingly
// or pass setRoute setter as vlaue to th Provider
@kitsonk
kitsonk / bronto.ts
Last active August 10, 2022 12:03
Example Deno Static Server
import {
green,
cyan,
bold,
yellow,
red
} from "https://deno.land/[email protected]/fmt/colors.ts";
import {
Application,
@kauffmanes
kauffmanes / install_anaconda.md
Last active November 20, 2024 02:50
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
wget -r --mirror --warc-file=pst --warc-cdx --page-requisites --html-extension --convert-links --execute robots=off --directory-prefix=. --span-hosts --domains=images.example.net,assets.example.net,example.net,pacificstandardtime.org --user-agent="Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" --random-wait http://www.example.com
@surma
surma / package.json
Created April 18, 2018 15:07
Boilerplate for quick one-off TypeScript projects. Just run `npm start`
{
"name": "tsquickstart",
"version": "1.0.0",
"description": "Boilerplate for quick one-off TypeScript projects. Just run `npm start`",
"scripts": {
"init": "test -f tsconfig.json || (tsc --init -t ESNext -m ESNext && npm install)",
"start": "npm run init && concurrently \"npm run watch\" \"npm run serve\"",
"serve": "http-server",
"watch": "tsc -p . --watch",
"build": "tsc -p ."
{
"Afghanistan":[
"China",
"Iran",
"Pakistan",
"Tajikistan",
"Turkmenistan",
"Uzbekistan"
],
"Albania":[
@ljharb
ljharb / array_iteration_thoughts.md
Last active October 24, 2024 07:30
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@noelboss
noelboss / git-deployment.md
Last active November 19, 2024 08:04
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

var creativity = [{
space: function(artist, object) {
// check the artis and object being painted
if (!artist && !object) {
return allOtherSpace;
anonymous
anonymous / imgurbar.user.js
Created February 20, 2015 21:08
Imgur vote bar
// ==UserScript==
// @name Imgur vote bar
// @namespace http://www.jaswin.net
// @description Adds the vote bar back to imgur
//
// @include *imgur.com/gallery/*
//
// @version 1.0
// @require http://code.jquery.com/jquery-1.11.0.min.js
// @grant None