Skip to content

Instantly share code, notes, and snippets.

View lmonkiewicz's full-sized avatar

Łukasz Monkiewicz lmonkiewicz

View GitHub Profile
@ciaranmcnulty
ciaranmcnulty / notes.md
Last active March 25, 2024 06:36
Notes on using Docker on ARM Macs (November 2021)

Docker for Mac

On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker) might require Rosetta.

Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)

Pulling and running with Docker

Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli image has the following digests:

@meirbon
meirbon / Installing elementary on XPS 9560
Last active March 13, 2023 14:00
Install guide for Elementary OS on Dell XPS 15 9560
# Install Elementary like you normally would, after install disable dGPU
# If you don't need your dGPU in Linux: https://gist.github.com/jseris/a740f6a3fb0d18064e26dc66f9be4f1d
# If you want to use your Nvidia GPU:
sudo apt install nvidia-375 nvidia-prime
##### Seems this is fixed #####
# Don't restart yet, the version of nvidia-prime that is shipping does not work
# cd /usr/bin && sudo mv prime-select prime-select.old
# sudo wget https://raw.githubusercontent.com/C11235/nvidia-prime-bugfix/master/prime-select && sudo chmod 755 prime-select
@jordi-t
jordi-t / disable-dgpu-xps9560-ubuntu-1610
Last active October 8, 2022 13:57
Disabling dGPU on Dell XPS 9560 on Ubuntu 16.10
# Tested with kernel: 4.9.20-040920-generic
#
# Make sure to install following packages
#
sudo apt install acpi acpi-call-dkms
#
# To manually disable, you can run the following command
#
@jasonswearingen
jasonswearingen / redux-simple-router-example.tsx
Last active October 31, 2017 19:37
A simplified example of redux + redux-simple-router using Typescript
/**
WHAT: A very simple example of redux + redux-simple-router using Typescript.
WHY: The official example found here: https://github.com/rackt/redux-simple-router/tree/1.0.2/examples/basic has problems:
1) it is spread over many files making it very hard to "skim"
2) it is organized by function, not by feature. (Example: learning "how to manipulate redux state" is spread over 5 files in 4 folders)
3) there are no comments explaining what's going on/why.
WHO: by JasonS@Novaleaf.com
@elaatifi
elaatifi / App.java
Created December 17, 2015 20:04
Playing with Orika and Mongo
package mongo.mongo;
import java.util.Arrays;
import java.util.List;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
@Couto
Couto / webpack.js
Last active November 7, 2024 13:10
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@LeeSanghoon
LeeSanghoon / ShortUUID.java
Last active May 29, 2023 19:35
Generate short UUID
import java.nio.ByteBuffer;
import java.util.UUID;
/**
* Generate short UUID (13 characters)
*
* @return short UUID
*/
public static String shortUUID() {
UUID uuid = UUID.randomUUID();