Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@khakimov
khakimov / gist:3558086
Created August 31, 2012 19:49
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active April 1, 2024 13:55
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@nasser
nasser / render.js
Created January 7, 2021 18:10
Flat template rendering in node.js in two lines of code
const render = (template, values) =>
template.replace(/\{\{([^}]+)\}\}/g, (_, key) => values[key]);
render("hello {{place}}", { place: "world" })
// => "hello world"
render("shell='{{SHELL}}', term='{{TERM}}'", process.env)
// => "shell='/bin/bash', term='xterm-256color'"

Hyperswarm DHT setup

Checking your network for P2Pness

Running a node

Running a dht node is as simple as installing the DHT cli.

npm i -g @hyperswarm/cli
@cosmicmonster
cosmicmonster / ShuffleArray.cs
Last active March 1, 2021 13:36
Unity / C# code to shuffle an array using the Fisher-Yates Shuffle.
using UnityEngine;
using System.Collections;
public class ShuffleArray : MonoBehaviour {
// Public so you can fill the array in the inspector
public int[] scenarios;
void Start ()
const tape = require('tape')
const hypercore = require('hypercore')
const ram = require('random-access-memory')
const { runAll, replicate } = require('./lib/util')
const { Kappa } = require('..')
const createIndexer = require('../sources/hypercore-sparse')
const topics = ['red', 'blue', 'green', 'yellow']
@colby
colby / 12pomodoro.md
Last active August 1, 2019 16:59
The 12 Pomodoro Workday

The 12 Pomodoro Workday

Or the 25 hour work week. Heavily borrowed from cblgh.

The Planning

The structure is simple:

  • 1 pomodoro planning the work day
  • 8 pomodoros of work
  • 3 pomodoros of break

1+8+3=12 pomodoros,

@nicooprat
nicooprat / grid.less
Last active August 1, 2019 09:07
First try to port Unsemantic to LESS. (http://unsemantic.com/)
// http://unsemantic.com/
// -------------------
// Variables
// -------------------