Skip to content

Instantly share code, notes, and snippets.

View kheyro's full-sized avatar

Denis Atk. kheyro

View GitHub Profile
@kheyro
kheyro / private_fork.md
Created April 26, 2023 20:20 — forked from 0xjac/private_fork.md
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 [email protected]:usi-systems/easytrace.git

@kheyro
kheyro / git-change-commit-messages.md
Created September 5, 2018 14:40 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@kheyro
kheyro / get-file-extension
Last active May 27, 2018 16:46
[[JS] Get file extension]
file.split('.').pop();
@kheyro
kheyro / js-hidden-tricks.md
Last active April 11, 2018 14:43
[[JS] Hidden tricks] Every little tricks / shorthand that I would have never thought of

Double tilde ~~ operator

Single ~ is a bitwise NOT

function(x) {
  if(x < 0) return Math.ceil(x);
  else return Math.floor(x);
}
@kheyro
kheyro / js-string-contains-substring.md
Last active April 11, 2018 09:23
[[JS] String contains a substring?] All the differents ways to find if a string contains a substring

1. ES6 includes - got to answer

let string = "foo",
  substring = "oo";
string.includes(substring);
// true

2. ES5 and older indexOf

@kheyro
kheyro / js-array-methods.md
Last active July 8, 2018 20:09
[[JS] Array methods] Javascript Array Cheat Sheet

TODO

  • Add filter
  • Add for ... of ...
  • Precise Destructive / Non-destructive
  • Spread operator ...
  • Add reduce()
  • Add find()

Summary