Skip to content

Instantly share code, notes, and snippets.

View arienkock's full-sized avatar

Arien Kock arienkock

  • The Hague, The Netherlands
View GitHub Profile
@arienkock
arienkock / github-all-the-things.sh
Created August 31, 2019 13:33
Script to create a private remote on GitHub (using the REST API) and pushing `--all` refs to it from a local repo. Useful if you have many local experimental repos and no remotes for backup.
#!/usr/bin/env bash
REPO_DIR=$1
if [ -z $GH_USERNAME ] || [ -z $GH_PASSWORD ]; then
echo "Env vars GH_USERNAME and GH_PASSWORD are required."
exit 1
fi
if [ -z $REPO_DIR ]; then
echo "You must specify a repo directory as first argument to this command."
@arienkock
arienkock / gist:692316d3c8234f45f9dfcc604efdec0c
Created June 14, 2019 14:12
Interesting webdev articles
About how JavaScript is secretly compiled to make it fast, and how not to ruin that performance.
https://www.html5rocks.com/en/tutorials/speed/v8/
About the super-misunderstood `vertical-align` CSS property.
https://christopheraue.net/design/vertical-align
About OOP in JavaScript. Lots of talk on prototypes.
http://nekocm.blogspot.com/2012/04/object-oriented-javascript-1.html
Another CSS property with some hidden secrets: Z-Index

Topics covered on Monday. Use resources to solidify your understanding:

  • Components [2]
  • Props [2]
  • State [3]
  • Fetching data with an HTTP client [4]
  • Mapping over an array of values to JSX [1]
  • Virtual DOM [5]

Topics for Tuesday:

  • Deploy a webapp

What is this?

During the Codaisseur Academy we cover a lot of material in a short time. This is a curated list of resources that covers most topics that we teach during the academy.

You won't have the extra context or coaching that Codaisseur Academy students get, but with these materials and a lot of dedication you can get there at your own pace.

The List

One of the best places to start. It covers the basics of the technologies that the web is built on.

@arienkock
arienkock / homework.md
Created May 4, 2018 19:12
IB week 1 homework

A Shopping Cart in React

Note: we'll use the results of this homework assignment for a formal evaluation and as such you should write the code individually. Plagiarism is a violation of the Academy contract and makes nobody happy.


Intro

We will display a list of products with prices. We will be asking you to apply several skills you've learned this week.

import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@arienkock
arienkock / CacheBustFilter
Last active October 8, 2015 08:38
A 2.3 Servlet Filter that rewrites URI's pointing to .js and .css files that run through HttpServletResponse#encodeURL(String) to contain hashes of the target files. This serves the purpose of assuring that caching headers set on those resources don't stop newer/changed versions of the resources from being downloaded by browsers.
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@arienkock
arienkock / FixedRateInterceptor.java
Last active August 29, 2015 14:03
A fixed rate limiter for HTTP requests. Can be used to avoid being blocked by throttle-limited API's like Facebook.
package net.webapp.util;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;