Skip to content

Instantly share code, notes, and snippets.

Timi Aiyemo cozzbie

Block or report user

Report or block cozzbie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View raspbian_setup.file
# recovery.cmdline
# /os/Raspbian/
# Enable SSH
echo 'ssh' >/tmp/1/ssh
# Configure WiFi
echo 'ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev' >> /tmp/1/wpa_supplicant.conf
View selecttxt.js
const selection = window.getSelection();
const range = document.createRange();
const element = document.getElementById('elmt');
// Collect a range based off the contents of an element.
// Clear ranges that might be stored in the selection object.
View intToBase2.js
let convertIntToBase2 = (n, p) => {
p += n % 2;
return n <= 0 ? p.split('').reverse().join('') : convertIntToBase2(parseInt(n / 2), p);
cozzbie / bash.cheat
Created Jul 6, 2018 — forked from afair/bash.cheat
Bash Scripting Quick Reference
View bash.cheat
BASH SCRIPTING ==========================================
========================================== TEST COMMAND
Invoke: bash [options] file
Shebang: #!/usr/bin/env bash Test: test expression
In script: [ expression ]
========================================== Alternate: [[ espression ]]
LOOP Does not split string words
========================================== Does not expand pathglobs*
cozzbie /
Created Jul 2, 2018 — forked from bastman/
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
View Dockerfile
LABEL net.skyplabs.maintainer-name="Paul-Emmanuel Raoul"
LABEL net.skyplabs.maintainer-email=""
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium
View bitwise-add-subtract.js
function add(a, b) {
if(b == 0) return a;
return add(a ^ b, (a & b) << 1);
add(4, 5) // 9
function subtract(a, b) {
return (add(a, add(~b, 1)));
View pwa.js
// Flag for enabling cache in production
var doCache = false;
var CACHE_NAME = 'pwa-app-cache';
// Delete old caches
self.addEventListener('activate', event => {
const currentCachelist = [CACHE_NAME];
View webrtcaliceremote.js
alice.setRemoteDescription(new RTCSessionDescription(data)) // 'data' is the session sent from Bob.
You can’t perform that action at this time.