Skip to content

Instantly share code, notes, and snippets.

View hudson-newey's full-sized avatar
😶‍🌫️
Whoops

Hudson Newey hudson-newey

😶‍🌫️
Whoops
View GitHub Profile
@hudson-newey
hudson-newey / python_init.sh
Last active May 11, 2024 03:42
A generic python & python3 virtual environment initialiser.
#!/usr/bin/env bash
set -euo pipefail
# installs a local virtual environment
initilize_python_virtual_environment() {
# check what python version to use
which python3;
USE_PYTHON3=0;
if [ $? -eq 0 ]; then
USE_PYTHON3=1;
@fuweichin
fuweichin / index.html
Last active June 13, 2024 05:17
User Agent Client Hints API (navigator.userAgentData) polyfill and ponyfill
<h3>native navigator.userAgentData</h3>
<pre><code id="naviveUserAgentData">...</code></pre>
<h3>polyfilled navigator.userAgentData</h3>
<pre><code id="customUserAgentData">...</code></pre>
<script type="module">
import {ponyfill, polyfill} from './user-agent-data.js';
const $ = (s, c = document) => c.querySelector(s);
@Yousha
Yousha / .gitattributes
Created March 24, 2021 09:55
.gitattributes for assets/documents.
* text=auto
###### Git
.gitattributes text
.gitignore text
.gitconfig text
.gitmodules text
##### Windows
*.bat text eol=crlf
@debashisbarman
debashisbarman / forwardport.sh
Created May 15, 2020 10:43 — forked from Bostonncity/forwardport.sh
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active July 20, 2024 03:54
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@karlhadwen
karlhadwen / .zshrc
Last active April 12, 2024 01:56
.zshrc settings
export ZSH="/Users/karlhadwen/.oh-my-zsh"
export PATH=${PATH}:/usr/local/mysql/bin/
ZSH_THEME="robbyrussell"
ZSH_DISABLE_COMPFIX=true
plugins=(
git
zsh-autosuggestions
last-working-dir
@rjcorwin
rjcorwin / use-lit-element-in-an-angular-project.md
Last active January 1, 2023 11:43
Directions on how to use Lit Element as a replacement to `@angular/core`'s `Component` decorator.

How to use Lit Element in an Angular Project

Directions

  1. In tsconfig.json, set "target" to "es6".
  2. Add schemas: [ CUSTOM_ELEMENTS_SCHEMA ], in the NgModule decorator of the Angular Module where your components will live.
  3. Use Angular CLI to generate a component.
  4. Refactor generated Component's import statement, decorator, constructor, and add a render function as seen in the example below.
  5. Refactor the import statement of the Component in the parent Module from import { HelloWorldComponent } from './hello-world/hello-world.component' to import './hello-world/hello-world.component'
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active July 17, 2024 15:17
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@johnmcfarlane
johnmcfarlane / begin(C++).md
Last active June 26, 2024 14:42
Resources for C++ beginners