Skip to content

Instantly share code, notes, and snippets.

View IOIO72's full-sized avatar
🚂

Tamio Honma IOIO72

🚂
View GitHub Profile
@wojtekmaj
wojtekmaj / .gitignore
Last active April 23, 2024 13:08
How to upgrade Yarn to Yarn Modern (v4 at the moment) seamlessly
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
@rcarmo
rcarmo / .zshrc
Last active December 25, 2023 06:41
My zsh configuration
# =======
# GLOBALS
# =======
if [[ "$(uname)" == "Darwin" ]]; then
platform="Darwin"
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
platform="Linux"
else
platform="POSIX"
@debovis
debovis / package.json
Last active January 16, 2024 14:13
How to debug gatsby and reactjs with webstorm
{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "n/a",
"scripts": {
"serve": "gatsby develop -p 5000",
"dev": "node $NODE_DEBUG_OPTION ./node_modules/.bin/gatsby develop -p 5000",
}
}
@jamiew
jamiew / brew-sync.sh
Created January 8, 2016 17:14 — forked from witt3rd/brew-sync.sh
Sync Homebrew installations between Macs via Dropbox (including casks)
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@cvan
cvan / eventKeyPolyfill.js
Last active August 1, 2016 13:24
polyfill `event.key` for Chrome (and other non-Firefox browsers) - named keys
// Disclaimer: for now, this works for only US ASCII keyboards.
var KEYCODES_TO_KEYS = {
3: 'Cancel',
6: 'Help',
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
@LightAtPlay
LightAtPlay / gist:24148d8be2e66d26fd11
Last active June 7, 2021 23:41
HSB/HSV to RGB converter and demo for OpenSCAD
function hsv(h, s = 1, v = 1, a = 1, p, q, t) = (p == undef || q == undef || t == undef)
? hsv(
(h%1) * 6,
s<0?0:s>1?1:s,
v<0?0:v>1?1:v,
a,
(v<0?0:v>1?1:v) * (1 - (s<0?0:s>1?1:s)),
(v<0?0:v>1?1:v) * (1 - (s<0?0:s>1?1:s) * ((h%1)*6-floor((h%1)*6))),
(v<0?0:v>1?1:v) * (1 - (s<0?0:s>1?1:s) * (1 - ((h%1)*6-floor((h%1)*6))))
)
@blu3Alien
blu3Alien / pingscan.sh
Created January 21, 2013 13:16
Shell script to scan a range of IP addresses. USAGE: ./pingscan 192.168.1.
#!/bin/sh
: ${1?"Usage: $0 ip subnet to scan. eg '192.168.1.'"}
subnet=$1
for addr in `seq 0 1 255 `; do
# ( echo $subnet$addr)
( ping -c 3 -t 5 $subnet$addr > /dev/null && echo $subnet$addr is Alive ) &
done
@CatTail
CatTail / htmlentity.js
Created November 30, 2012 08:27
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {