Skip to content

Instantly share code, notes, and snippets.

View jamesseanwright's full-sized avatar
🤔

James Wright jamesseanwright

🤔
View GitHub Profile

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@Zekfad
Zekfad / conventional-commits.md
Last active August 28, 2025 03:35
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@pisarukv
pisarukv / read.go
Last active May 21, 2024 08:08
read.go
package docker
import (
"context"
"io"
"github.com/ory/dockertest"
"github.com/ory/dockertest/docker"
)
@thatisuday
thatisuday / fan-in-fan-out.go
Created November 19, 2018 15:32
fan-in and fan-out concept in go lang
package main
import (
"fmt"
"sync"
)
// return channel for input numbers
func getInputChan() <-chan int {
// make return channel
input := make(chan int, 100)
@ConorOBrien-Foxx
ConorOBrien-Foxx / obfs.js
Created January 20, 2017 02:12
888 byte Hello World in JavaScript
s=((C=f=>g=>(...a)=>f(g(...a)))&&(H=a=>[...a])&&(v=c=>a=>new(c)(a)))(Set);S=n=>[n,n].map(e=>e.map?e[1]:e).map((e,i)=>e.slice(...s([i,1])));O=J=e=>n=>(e+[])[n];p=h=>!(h&(1<<31)|!h);G=global;h=(f=[][1])=>(c=+[])=>(f+[])[c];E=s=>h(s)(+[]);R=H=>L(H).reverse();s=C((d=".",Z=x=>x))(C(H)(s));D=f=>()=>C(Z)(f);Y=(f,n)=>a=>p(n)?f(Y(f,~-n)(a)):a;L=H;T=(n,i,k=n)=>p(i)?T(n+k,--i,k):S(n)[++[[]][+[]]];f=(M=J)(![]);q=W=>Y(D,W);j=q(2)(E);w=0;X=d=>O=G[(U=x=>x[t](i*z*i+z+z-w++))(16465174322)];r=C((A=h(F=(()=>G)[c=`constructor`]),F)(b=[921631607,1061308,1160108].map(e=>e[t=`${o=(I=++i/0+[])[z=3<<1]}oS${i&&o}r${I[z/=2]}ng`]((2<<2<<2)+~-i)+[(T(A(2<<2),2)+d)[i]||[]],i=0).join``).bind({[z^i]:-192.3,[z-2]:402.4,[o+E(p)+I[z]+E(E)]:E(R)+f(2*2)+T(f(2),2)+J(c)`1`+j`````${j}`+A(2<<2)+E(q)+J(q?c:s)(J(z&~i)|1)+M(!+[])(1<<2>>2<<0)+f(2),[[14,2,3,6].map(A).join``]:640,y:420}))(X)();O[U(22288)](r+E(X)+M(p)(15));
// Talking console
//
// Support: http://caniuse.com/#search=SpeechSynthesisUtterance
//
// Copy paste the code into dev console or
// use http://mrcoles.com/bookmarklet/ to create a bookmarklet.
/* ✂️ ......................................................................................... */
if(console.log.name !== 'talkLog') {
console.l = console.log;
@BojanStipic
BojanStipic / fonts.conf
Last active April 27, 2019 13:56
Linux color emoji
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>NotoSans</family>
<family>NotoColorEmoji</family>
<family>NotoEmoji</family>
</prefer>
2d camera in canvas:
http://stackoverflow.com/questions/16919601/html5-canvas-camera-viewport-how-to-actally-do-it
Codeincomplete series on javascript games:
http://codeincomplete.com/games/
Coding Math:
http://www.codingmath.com/
Mary Rose Cook codes a Canvas game live in 30 minutes:
@thomheymann
thomheymann / function-declaration.js
Created October 5, 2015 16:50
Variable vs. function hoisting
// Both, function declaration and function body are hoisted to top of scope.
// Outside of scope, hence ReferenceError
console.log(foo); // ReferenceError: foo is not defined
(function () {
// Declaration and function body got hoisted to top of scope
console.log(foo); // [Function: foo]
console.log(foo()); // 'bar'
@ClaireNeveu
ClaireNeveu / scalaFlags
Last active July 5, 2017 17:15
Scala Flags
-Dproperty=value Pass -Dproperty=value directly to the runtime system.
-J<flag> Pass <flag> directly to the runtime system.
-P:<plugin>:<opt> Pass an option to a plugin
-X Print a synopsis of advanced options.
-bootclasspath <path> Override location of bootstrap class files.
-classpath <path> Specify where to find user class files.
-d <directory|jar> destination for generated classfiles.
-dependencyfile <file> Set dependency tracking file.
-deprecation Emit warning and location for usages of deprecated APIs.
-encoding <encoding> Specify character encoding used by source files.