Skip to content

Instantly share code, notes, and snippets.

View nash403's full-sized avatar
🦄
want a cookie ?

Honoré Nintunze nash403

🦄
want a cookie ?
View GitHub Profile
@hofmannsven
hofmannsven / README.md
Last active November 8, 2023 22:49
SCSS Cheatsheet
@Kartones
Kartones / postgres-cheatsheet.md
Last active June 13, 2024 20:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@eloone
eloone / binaryInsert.js
Last active June 22, 2019 15:43
Binary Insert
/**
* Example :
* var a = [2,7,9];
* binaryInsert(8, a);
*
* It will output a = [2,7,8,9]
*
*/
function binaryInsert(value, array, startVal, endVal){
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@szalishchuk
szalishchuk / ip.js
Last active December 14, 2022 11:04
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@nfreear
nfreear / floating-point-compare.js
Created July 4, 2013 13:02
Floating point Javascript: less than & greater than comparisons.
/*
http://stackoverflow.com/questions/4915462/how-should-i-do-floating-point-comparison
*/
var EPSILON = 0.000001;
function fp_less_than(A, B, Epsilon) {
Epsilon = Epsilon || EPSILON;
return (A - B < Epsilon) && (Math.abs(A - B) > Epsilon);
};
@aponxi
aponxi / sql-mongo_comparison.md
Last active February 21, 2024 11:56
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */