Skip to content

Instantly share code, notes, and snippets.

View karfau's full-sized avatar
🎯
Focusing

Christian Bewernitz karfau

🎯
Focusing
  • bettermarks GmbH
  • Saxony / Germany
  • 05:17 (UTC +02:00)
View GitHub Profile
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:flexui="flexunit.flexui.*"
xmlns:adobe="http://www.adobe.com/2009/flexUnitUIRunner"
minWidth="955" minHeight="600"
creationComplete="onCreationComplete()">
<fx:Script>
<![CDATA[
import org.flexunit.listeners.UIListener;
@karfau
karfau / gist:cd053e729e988827dcde
Created October 28, 2014 23:53
fix wifi on dell vostro 1000 on ubuntu 12.04 and up
# http://wireless.kernel.org/en/users/Drivers/b43
sudo modprobe -r b43 bcma
sudo modprobe -r brcmsmac bcma
sudo modprobe -r wl
sudo apt-get purge bcmwl-kernel-source
sudo apt-get update
sudo apt-get install firmware-b43-installer
#without connection: those drivers are on the install medium (at least for ubuntu 14) one might need to add it to the list of repositories
@karfau
karfau / Code.gs
Last active August 23, 2016 21:17
Google App Script to merge all documents from a GDrive Folder into a single GDocs document using an intermediate GSpreadsheet
var C_TYPE = 'Type',
C_TITLE = 'Title',
C_ID = 'ID',
C_URL = 'URL',
C_MIME_TYPE = 'file type',
C_ELEMENTS = 'elements in document';
var HEADERS = [C_TYPE, C_TITLE, C_ID, C_URL, C_MIME_TYPE, C_ELEMENTS];
function onOpen(){
@karfau
karfau / README.md
Last active June 4, 2017 19:17
Grav CMS Solution #X for localized date parts.
type Neighbors = {neighbors: number};
type State = Neighbors & {alive: boolean};
function deadCell({neighbors}: Neighbors): State {
return {alive: false, neighbors};
}
function livingCell({neighbors}: Neighbors): State {
return {alive: true, neighbors};
}
@karfau
karfau / .gitignore
Last active February 20, 2018 19:28
executes the parameters, checks the exit code, prints log file to stderr in case exit code is not 0, helpful for running crontab
/logs
@karfau
karfau / stackexchange-flair.md
Created November 14, 2019 21:43
stackexchange flair

karfau @ stackexchange.com

@karfau
karfau / multiplication.js
Last active November 15, 2019 18:19
math exercises
// requires lodash being present as _, e.g. in the dev console on https://lodash.com/docs
// random
var result = []; for (i=0;i<50;i++) {let a = `${_.sample.call(null, _.range(2, 21))} * ${_.sample.call(null, _.range(2, 16))}`; result.push(`${a} = ${eval(a)}`);} console.log(result.join('\n'))
// all ordered
var result = []; for (i=1;i<21;i++) { for (j=1;j<11;j++) { let a = `${i} * ${j}`; result.push(`${a} = ${eval(a)}`);}} console.log(result.join('\n'))
@karfau
karfau / .extend.docker.bashrc
Last active June 19, 2020 13:08
Aliases for docker and docker-compose alongside podman
# With my local setup in Manjaro I'm using https://podman.io/ as a rootless docker replacement:
# https://podman.io/getting-started/installation#arch-linux--manjaro-linux
# To be able to still run the real docker when required, but use podman by default I added this link:
# /usr/local/bin/docker -> /usr/bin/podman
# I wanted to have an easy way to switch to real docker and back so I created the following aliases:
# <name>su switches on <name>, un<name> switches off <name>
# since the tools all require docker daemon to run and calling 'sudo <name>',
# but most scripts assume it works wihtout sudo
# docker
@karfau
karfau / ormconfig.register.js
Last active December 8, 2019 20:04
workaround for typeorm no longer loading ormconfig.env by default
// Source: https://gist.github.com/karfau/b6d0927628f6662ca6d892153562522f
// 1. copy this file to your root directory alongside ormconfig.env
// in your package.json scripts/mocha.opts, etc add
// --reqister ./ormconfig.register.js
// or
// -r ./ormconfig.register.js
const {config} = require('dotenv');
const path = require('path');
config({path: path.join(__dirname, 'ormconfig.env')});