Skip to content

Instantly share code, notes, and snippets.

View luizwbr's full-sized avatar
👍
Now working with new frameworks!

Luiz Felipe Weber luizwbr

👍
Now working with new frameworks!
View GitHub Profile
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active November 19, 2024 21:50
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

@pkellner
pkellner / next.config.js
Created November 11, 2018 21:43
Sample next.config.js for Next.js that includes environment variables, and other plugins (CSS and Image)
const withCSS = require("@zeit/next-css");
require('dotenv').config()
const path = require('path')
const Dotenv = require('dotenv-webpack')
const withImages = require('next-images')
module.exports = withCSS(withImages({
inlineImageLimit: 16384,
webpack(config, options) {
@sebmarkbage
sebmarkbage / The Rules.md
Last active November 3, 2024 19:53
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@derekchiang
derekchiang / app.html
Last active August 13, 2024 08:01 — forked from bellbind/app.html
[electron]Use electron as a Web Server
<!doctype html>
<html><head><script src="app.js"></script></head><body></body></html>
@ijokarumawak
ijokarumawak / 0.NIFI-EnforceOrder-Example.md
Last active February 15, 2022 11:13
NiFi EnforceOrder example template to sequentially process files by file names.

Process files in order by filename

Result

Without EnforceOrder

e
@rafaelpatro
rafaelpatro / magento-frontend-scripts.md
Last active July 20, 2018 16:07
Magento Frontend Scripts

Improve Magento frontend

The scripts below require nothing but itself.

  • No module installation
  • No FTP access
  • No third party integration
  • No plans
  • Only CMS > Blocks/Widgets
@vlucas
vlucas / encryption.js
Last active November 15, 2024 01:39
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@singhshivam
singhshivam / Immutable JS Examples
Last active August 5, 2023 19:16
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@vankasteelj
vankasteelj / gunzipbase64.js
Last active June 15, 2021 21:41
gzip without header and base 64 encode, in Node
var fs = require('fs');
var zlib = require('zlib');
// Read local subtitle, gunzip it, encode to base64
var toUpload; // future gunzipped/base64 encoded string
var path = 'foo/bar.srt'; // path to subtitle
fs.readFile(path, function(err, data) { // read subtitle
if (err) throw err; // handle reading file error
zlib.deflate(data, function(err, buffer) { // gunzip it
if (err) throw err; // handle compression error