Skip to content

Instantly share code, notes, and snippets.

View LucaColonnello's full-sized avatar
👋
Come say hello on Twitter!

Luca Colonnello LucaColonnello

👋
Come say hello on Twitter!
View GitHub Profile
@LucaColonnello
LucaColonnello / example.js
Created September 10, 2020 09:33
Custom Express like middleware system
const task = (data) => {
console.log('perform task with', data);
};
const middlewares = [];
middlewares.push((data, next) => {
console.log('add custom data', data);
next({ ...data, type: 'humanoid', power: 'pizza tasting' });
});
@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active May 6, 2024 14:31
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",

How Fast if Git?

The web is full of benchmarks showing the supernatural speed of Git even with very big repositories, but unfortunately they use the wrong variable. Size is not important, but the number of files in the repository really is!

Why is that? Well, that's because Git works in a very different way compared to Synergy. You don't have to checkout a file in order to edit it; Git will do that for you automatically. But at what price?

The price is that for every Git operation that requires to know which files changed (git status, git commmit, etc etc) an lstat() call will be executed for every single file

Wow! So how does that perform on a fairly large repository? Let's find out! For this example I will use an example project, which has 19384 files in 1326 folders.

@canhnt
canhnt / git-delete-local-tag.sh
Created August 9, 2017 09:11
Delete local tags that do not exist in remote
git fetch --prune origin "+refs/tags/*:refs/tags/*"
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@dahlbyk
dahlbyk / projects.graphql
Created September 15, 2016 00:09
GraphQL to fetch GitHub Projects+Columns+Cards with issue/PR detail for a specific repo.
{
search(type: REPOSITORY, query: "org:huboard-testing spooky-octo-pug", first: 1) {
edges {
node {
__typename
... on Repository {
owner {
id
}
name
@gianmarcotoso
gianmarcotoso / Sort.jsx
Last active June 18, 2017 15:34
React Sort HoC
import React from 'react';
import { Component } from 'react';
let Sort = Sortable => class extends Component {
constructor(props) {
super(props);
this.state = {
items: []
}
@gianmarcotoso
gianmarcotoso / Filter.jsx
Last active March 10, 2016 16:30
React Filter HoC
import React from 'react';
import { Component } from 'react';
let Filter = Filterable => class extends Component {
constructor(props) {
super(props);
this.state = {
items: props.items
};
@LucaColonnello
LucaColonnello / pipe-tag-es6-tpl-string.js
Created January 20, 2016 08:49
String leading whitespaces
// Strip margin (Leading whitespaces)
function pipeFactory( separator = ' ' ){
return (s, ...args) => {
return s
.map(( v, i ) => v + ( args[i] || '') )
.join('')
.replace(/(\r\n|\r|\n)([\s]+)?\|/g, separator)
;
};
@LucaColonnello
LucaColonnello / # Redux Async Actions Utils
Last active January 16, 2016 11:05
Redux Async Actions Utils
Lib purpose