Skip to content

Instantly share code, notes, and snippets.

View sepsol's full-sized avatar
:electron:
Hyperstate

Sepehr Soltanieh sepsol

:electron:
Hyperstate
View GitHub Profile
@silent1mezzo
silent1mezzo / 0fixup.md
Last active October 15, 2024 06:44 — forked from SethRobertson/index.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@JamieMason
JamieMason / unfollow.js.md
Last active December 22, 2024 11:48
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

By @foldleft.bsky.social, see also Unfollow everyone on bsky.app.

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
@iamnewton
iamnewton / bash-colors.md
Last active December 20, 2024 16:32
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@pjdietz
pjdietz / rfc3339.js
Last active May 27, 2024 12:25
Format a local date as an RFC 3339 date with timezone
function rfc3339(d) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
function timezoneOffset(offset) {
var sign;
if (offset === 0) {
return "Z";
@wilwang
wilwang / gist:4771a60f427fca97dd8dec3eabbae095
Created July 15, 2016 22:28
Powershell - Loop through sub directories and look for and rename file
$targDir = "C:\inetpub\websites\ADA*\";
$subDir = $(Get-ChildItem "$targDir");
foreach($sub in $subDir) {
$files = $(Get-Childitem $sub -Filter app_offline*.htm);
foreach($file in $files) {
$oldname = $file.FullName;
@Rich-Harris
Rich-Harris / footgun.md
Last active October 8, 2024 15:14
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@0xjac
0xjac / private_fork.md
Last active December 25, 2024 21:07
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@simov
simov / README.md
Last active October 8, 2024 11:55
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
@mohamadaliakbari
mohamadaliakbari / ubuntu-run-dhclient-on-startup.md
Last active July 31, 2024 08:46
Run dhclient on Startup in Ubuntu 18.04

dhclient is the Dynamic Host Configuration Protocol (DHCP) Client one would use to allow a client to connect to a DHCP server.

$ sudo nano /etc/rc.local

#!/bin/bash
dhclient
exit 0
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active December 1, 2024 08:09
Building a react native app in WSL2