Skip to content

Instantly share code, notes, and snippets.

View azz's full-sized avatar
🍣
和食が恋しいよ

Lucas Azzola azz

🍣
和食が恋しいよ
View GitHub Profile
@jsamuel1
jsamuel1 / aws-s3-buckets-with-tags.sh
Last active February 25, 2019 04:36 — forked from filipenf/aws-s3-buckets-with-tags.sh
Print a list of aws buckets along with their tags
#!/bin/bash
# lists all buckets along with their tags in the following format:
# bucket_name | { tag_name: tag_value }
for bucket in `aws s3api list-buckets | jq .Buckets[].Name -r`; do
tags=$(aws s3api get-bucket-tagging --bucket $bucket 2>/dev/null | jq -c '.[][] | {(.Key): .Value}' | tr '\n' '\t')
echo $bucket '|' $tags
done
; function findItem() { ;
; var item ;
; while(item_not_found) { ;
// search
; } ;
; return item ;
; } ;
; var item = findItem() ;
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active July 17, 2023 02:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@azz
azz / github-to-octobox.js
Last active July 16, 2019 07:57
UserScript: GitHub Notifications -> octobox.io
// ==UserScript==
// @name GitHub Notifications -> octobox.io
// @namespace https://gist.github.com/azz/9ce50b3596b6f7f062523040ebbb5708/edit
// @version 1.1.1
// @description Redirect the GitHub Notification icon to octobox.io
// @author Lucas Azzola <@azz>
// @match https://github.com/*
// @grant none
// ==/UserScript==

Motivation

  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small

Examples

Write in an expression-oriented style, scoping variables as locally as possible:

@ryanflorence
ryanflorence / Performance Conditionally Rendered Content in React.md
Last active December 30, 2023 18:12
Performance Conditionally Rendered Content in React

Performance and Conditionally Rendered Content in React

First, this is not about if in JSX. It's just the simplest example to talk about (and a lot of people tried to do it at first a long time ago).

Some react components conditionally render content. When React first went public, a lot of us coming from handlebars really wanted "if" syntax. This gist isn't just about If components though, it's about

@orjan
orjan / checkout-pr.md
Last active August 7, 2020 21:40
Checkout pull request in Bitbucket server

Checking out pull requests in Bitbucket

/.git/config
[remote "origin"]
    url = ssh://git@git.dev.viaeuropa.int:7999/brikks/brikks.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = +refs/pull-requests/*/from:refs/remotes/origin/pull-requests/*
    fetch = +refs/pull-requests/*/merge:refs/remotes/origin/pull-requests-merge/*
@azz
azz / react+two.js.jsx
Last active April 15, 2023 14:28
Two.js and React with ES6
"use strict";
import React from "react";
import Two from "two";
class TwoTest extends React.Component {
constructor (props) {
super(props);
this.state = {

From Fabrice Bellard, with minor name change (umulh):

// return the high 32 bit part of the 64 bit addition of (hi0, lo0) and (hi1, lo1)
Math.iaddh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the 64 bit subtraction of (hi0, lo0) and (hi1, lo1)
Math.isubh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the signed 64 bit product of the 32 bit numbers a and b