Skip to content

Instantly share code, notes, and snippets.

View hugows's full-sized avatar
🏠
Working from home

Hugo Schmitt hugows

🏠
Working from home
View GitHub Profile
@jakub300
jakub300 / run.sh
Last active January 9, 2022 01:48
Compile headless shell (Chromium)
# Based on:
# https://web.archive.org/web/20200212121848/http://www.zackarychapple.guru/chrome/2016/08/24/chrome-headless.html
# https://www.chromium.org/developers/how-tos/get-the-code
# https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
apt-get update
apt-get install -y curl git htop man unzip vim wget python
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:`pwd`/depot_tools
mkdir Chromium && cd Chromium
@cecilemuller
cecilemuller / js_createclass.js
Last active June 5, 2018 16:04
React: "JSX + ES class" vs "Vanilla JS + createClass"
// Non-JSX and React.createClass
import {createClass, createElement, PropTypes} from 'react';
import css from './Application.css';
export default createClass({
displayName: 'Application',
propTypes: {
title: PropTypes.string
},
handleClick(): void {

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@lqd
lqd / gist:1c841dea193698bf50fefa19c6b3fb99
Last active December 10, 2023 19:17
Some of my favorite development streams and shows
Why coding streams/shows are interesting to me: in some livestreams, the experience is very similar to pair programming,
but those people are experts. In VODs, it's more about problem solving and learning skills and approaches. The devs are really good
at what they do and there is *always* a lot to learn.
In no particular order:
1) Handmade Hero
About the author: Casey Muratori. Worked at RAD.
Description and why I like it: It kinda started the whole thing for me. Casey is coding a complete game and engine on stream,
from scratch, one hour a day. He knows what he's doing on so many of the domains of game development and regular programing,
@pervognsen
pervognsen / btree.inl
Last active June 15, 2019 17:23
Experiments in lightweight C templates
// Here is btree.inl, which is the thing you would write yourself.
// Unlike C++ templates, the granularity of these lightweight templates is at the
// module level rather than the function or class level. You can think of it like
// ML functors (parameterized modules) except that there isn't any static checking
// of signatures (in that respect, it's like C++ templates). In my view, this style
// of parameterized generative modules is generally the better conceptual framework.
// This is a completely valid C file even prior to preprocessing, so during library
// development you can just include this file directly. That is a big win for testing
@uucidl
uucidl / 00-notes-about-APIs.org
Last active October 18, 2022 09:14
Notes about APIs

On the emergence of interfaces

Interfaces naturally emerge as software gets broken down into parts communicating with one another. The larger and more deliberate structures emerge from a deliberate attempt to organize the development process itself. [fn:Liskov2008] Structure often emerge directly from division of labor: as teams take on independent tasks, interfaces are established betweeen domains they become responsible for. (Conway’s Law)

Software developers are responsible for systems built out of very small atoms while ultimately performing tasks for their users of a much greater magnitude. Dijkstra showed this by computing the ratio between grains of time at the lowest and largest atoms of the system (from say, CPU instructions to a human interaction with the system) The span was already quite large by Dijkstra’s time, of about 10^9. Today this ratio would be at least above 10^12 (see grain ratios)

This large span has to be manage

@nf
nf / vm-setup.sh
Last active June 14, 2023 22:08
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
function makeStyle(defaults, tagName) {
tagName = tagName || 'div';
var Style = React.createClass({
getDefaultProps: function() {
return assign({}, defaults);
},
render: function() {
var style = assign({}, this.props);
delete style.children;
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)