Skip to content

Instantly share code, notes, and snippets.

View eliamartani's full-sized avatar
Coffee please

Eliamar Tani eliamartani

Coffee please
View GitHub Profile
@DavidWells
DavidWells / github-proxy-client.js
Last active March 15, 2024 08:28
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@endel
endel / number-pad-zero.js
Last active August 1, 2023 11:54
Simplest way for leading zero padding in JavaScript
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
(1).pad(3) // => "001"
(10).pad(3) // => "010"
(100).pad(3) // => "100"
@gokulkrishh
gokulkrishh / media-query.css
Last active April 24, 2024 17:27
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@joshuapowell
joshuapowell / reset.less
Last active December 12, 2021 13:35
LESS: Global LESS CSS reset that gives elements default formatting.
/**
* Global Reset of all HTML Elements
*
* Resetting all of our HTML Elements ensures a smoother
* visual transition between browsers. If you don't believe me,
* try temporarily commenting out this block of code, then go
* and look at Mozilla versus Safari, both good browsers with
* a good implementation of CSS. The thing is, all browser CSS
* defaults are different and at the end of the day if visual
* consistency is what we're shooting for, then we need to