Skip to content

Instantly share code, notes, and snippets.

View VictorCoding's full-sized avatar
💭
Breaking shit

Victor Ramos VictorCoding

💭
Breaking shit
  • Brownsville
View GitHub Profile
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
@tkh44
tkh44 / logWithLabel.js
Last active September 13, 2022 02:34
Little utility to format logs in a consistent manner
const a = { foo: 'bar' };
const b = 'I like cookies';
export const logWithLabel = (content, label, collapsed = false) => {
if (__DEVELOPMENT__) {
content = Array.isArray(content) ? content : [content];
console[collapsed ? 'groupCollapsed' : 'group'](label.toUpperCase());
content.forEach((c) => {
$colours:
"red" #FF0000,
"blue" #001EFF,
"green" #00FF00,
"yellow" #F6FF00;
@each $i in $colours{
.#{nth($i, 1)}-background {
background: nth($i, 2);
}
@hjst
hjst / gist:1326755
Last active November 21, 2018 05:22
Format a javascript Date object as a 12h am/pm time string.
function format_time(date_obj) {
// formats a javascript Date object into a 12h AM/PM time string
var hour = date_obj.getHours();
var minute = date_obj.getMinutes();
var amPM = (hour > 11) ? "pm" : "am";
if(hour > 12) {
hour -= 12;
} else if(hour == 0) {
hour = "12";
}