Skip to content

Instantly share code, notes, and snippets.

View ustun's full-sized avatar

Ustun Ozgur ustun

View GitHub Profile
@tuco86
tuco86 / Dockerfile
Last active May 30, 2019 21:05
Build packages as wheels, then install in small container.
FROM python:3.7-slim-stretch AS build
RUN \
apt-get -q update \
&& apt-get -q install -y --no-install-recommends \
build-essential \
libssl-dev \
&& rm -rf /var/lib/apt/lists/* \
&& pip install -U pip

TL;DR: what was the bug? (spoilers!): https://gist.github.com/trptcolin/6039cd454acfe6e820d13cbdce5e4064

@jeswin
jeswin / router-article.full.html
Last active January 24, 2020 13:39
router-article-full
<html>
<head>
<script
src="https://unpkg.com/react@16/umd/react.development.js"
crossorigin
></script>
<script
src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"
crossorigin
></script>
@simonw
simonw / Dockerfile
Last active December 17, 2023 21:00
The Dockerfile used by the new Datasette Publish to generate images that are smaller than 100MB
FROM python:3.6-slim-stretch as csvbuilder
# This one uses csvs-to-sqlite to compile the DB, and then uses datasette
# inspect to generate inspect-data.json Compiling pandas takes way too long
# under alpine so we use slim-stretch for this one instead.
RUN apt-get update && apt-get install -y python3-dev gcc
COPY *.csv csvs/
RUN pip install csvs-to-sqlite datasette
RUN csvs-to-sqlite csvs/names.csv data.db -f "name" -c "legislature" -c "country"
@pgavlin
pgavlin / index.generated.ts
Last active March 31, 2020 03:46
Terraform to Pulumi migration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const config = new pulumi.Config();
const var_availability_zones = config.require("availabilityZones");
const var_public_key = config.get("publicKey") || "";
const aws_security_group_default = new aws.ec2.SecurityGroup("default", {
namePrefix: "example_sg",
import r2 from '@mcro/r2'
import puppeteer from 'puppeteer'
import * as _ from 'lodash'
const sleep = ms => new Promise(res => setTimeout(res, ms))
const onFocus = page => {
return page.evaluate(() => {
return new Promise(res => {
if (document.hasFocus()) {
res()
@vjeux
vjeux / x.md
Last active January 6, 2024 07:15
Ocaml / functional programming

I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...

import Raven from 'raven-js'
// Custom Redux-Thunk that catches errors
function createThunkMiddleware(extraArgument) {
return ({ dispatch, getState }) => next => action =>
{
if (typeof action === 'function')
{
const result = action(dispatch, getState, extraArgument);
@v0lkan
v0lkan / engineer.md
Last active June 7, 2021 07:18
The Evolution of a Software Engineer

This gist outlines the change in the depth and breadth of the tasks and responsibilities of a software engineer as she continuously improves herself.

I created this to supplement a discussion in an internal slack group; then I though the rest of the world might benefit from this too.

Contributions are always welcome.

Junior Engineer

  • Knowledge
@artschwagerb
artschwagerb / settings.py
Last active July 22, 2020 13:07
Django Logging to Syslog
from logging.handlers import SysLogHandler
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format' : "[YOUR PROJECT NAME] [%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt' : "%d/%b/%Y %H:%M:%S"
},
'verbose': {