Skip to content

Instantly share code, notes, and snippets.

View samuelastech's full-sized avatar
🎯
Focusing

Samuel A. Souza samuelastech

🎯
Focusing
View GitHub Profile
@adrianhajdin
adrianhajdin / cartItemStyles.js
Created November 28, 2020 16:30
Styles for an E-Commerce Web Tutorial
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles(() => ({
media: {
height: 260,
},
cardContent: {
display: 'flex',
justifyContent: 'space-between',
},
@diego3g
diego3g / NODE.md
Last active November 18, 2024 19:18
VSCode Settings (Updated)

⚠️ Note!

With VSCode version 1.94, the APC extension broke and there is no fix yet.

So, for those having issues with APC after the VSCode update, I recommend downloading the previous version of VSCode for now (https://code.visualstudio.com/updates/v1_93) and setting updates to manual by adding this to the editor's configuration:

"update.mode": "manual",
@HoweChen
HoweChen / opencv_from_base64.py
Last active August 6, 2024 19:03
[opencv_from_base64]read image from opencv with base64 encoding #OpenCV
import cv2
import numpy as np
import base64
image = "" # raw data with base64 encoding
decoded_data = base64.b64decode(image)
np_data = np.fromstring(decoded_data,np.uint8)
img = cv2.imdecode(np_data,cv2.IMREAD_UNCHANGED)
cv2.imshow("test", img)
cv2.waitKey(0)
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active November 13, 2024 18:53
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active November 18, 2024 23:14
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@nitin42
nitin42 / gc.js
Created September 23, 2017 17:50
Mark and Sweep Algorithm implementation
let HEAP = [];
const A = {
language: 'JavaScript'
};
HEAP.push(A);
const root = () => HEAP[0];
@ngot
ngot / multi-thread.js
Last active November 4, 2024 13:07
V8 Thread Demo
start(() => {
while(true)
{
print("a");
sleep(1000);
}
})
while(true)
{
@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

@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};