Skip to content

Instantly share code, notes, and snippets.

View cozzbie's full-sized avatar
👻

Timi Aiyemo cozzbie

👻
View GitHub Profile
# Manually change from css to scss:
ng config schematics.@schematics/angular:component.styleext scss
# From scratch:
ng new <project-name> --style=scss
# Set global default
ng config --global defaults.styleExt=scss
@cozzbie
cozzbie / code.bash
Last active June 12, 2019 19:50
code extensions
# code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension asvetliakov.snapshot-tools
code --install-extension auchenberg.vscode-browser-preview
code --install-extension cazzar09.Gradle
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension chrmarti.regex
code --install-extension CoenraadS.bracket-pair-colorizer
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
# recovery.cmdline
silentinstall
# /os/Raspbian/partition_setup.sh
# Enable SSH
echo 'ssh' >/tmp/1/ssh
# Configure WiFi
echo 'ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev' >> /tmp/1/wpa_supplicant.conf
const selection = window.getSelection();
const range = document.createRange();
const element = document.getElementById('elmt');
// Collect a range based off the contents of an element.
range.selectNodeContents(element);
// Clear ranges that might be stored in the selection object.
selection.removeAllRanges();
selection.addRange(range);
'\u001B[2j\u001B[0;0f'
let convertIntToBase2 = (n, p) => {
p += n % 2;
return n <= 0 ? p.split('').reverse().join('') : convertIntToBase2(parseInt(n / 2), p);
}
@cozzbie
cozzbie / bash.cheat
Created July 6, 2018 06:43 — forked from afair/bash.cheat
Bash Scripting Quick Reference
==========================================
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
cozzbie / docker-cleanup-resources.md
Created July 2, 2018 15:56 — forked from bastman/docker-cleanup-resources.md
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: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

FROM docker.io/node:8-stretch
LABEL net.skyplabs.maintainer-name="Paul-Emmanuel Raoul"
LABEL net.skyplabs.maintainer-email="skyper@skyplabs.net"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium
@cozzbie
cozzbie / bitwise-add-subtract.js
Last active June 27, 2018 07:20
Bitwise Addition
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)));
}