Skip to content

Instantly share code, notes, and snippets.

View HugoHeneault's full-sized avatar
😎

Hugo Heneault HugoHeneault

😎
View GitHub Profile
@HugoHeneault
HugoHeneault / _jsonPuller.md
Created September 18, 2022 10:15 — forked from jalcantarab/_jsonPuller.md
A Google apps script to pull json from a spreadsheet

JSON Puller - Google Apps Script

Transforms the data of a given Spreadsheet Sheet to JSON.

  • The frozen rows are taken as keys for the JSON.
  • The data taken for the values is only that after the frozen rows

Set up:

exportJSON(Spreadsheet) - transforms the data in the given sheet to JSON.

@HugoHeneault
HugoHeneault / main.dart
Created January 7, 2022 09:41
Future.forEach Object?
void main() async {
final List<String> alwaysRequiredFiles = ['some_path', 'other_path'];
await Future.forEach(alwaysRequiredFiles, (filepath) async {
// this fails: error: The argument type 'Object?' can't be assigned to the parameter type 'String'. (argument_type_not_assignable
final String file = filepath;
});
}
@HugoHeneault
HugoHeneault / Calcul de l'impot français par tranche (javascript)
Created February 15, 2017 21:31 — forked from bactisme/Calcul de l'impot français par tranche.js
Calcul de l'impot français par tranche (javascript)
// http://www.impots.gouv.fr/portal/dgi/public/popup?espId=1&typePage=cpr02&docOid=documentstandard_6182
function impotBareme(montant){
var impot = 0;
var tranches = new Array();
tranches.push([6011, 0]);
tranches.push([11991, 0.055]);
tranches.push([26631, 0.14]);
tranches.push([71397, 0.30]);
tranches.push([151200, 0.41]);
// Create new object to cache iframe offsets
$.ui.ddmanager.frameOffsets = {};
// Override the native `prepareOffsets` method. This is almost
// identical to the un-edited method, except for the last part!
$.ui.ddmanager.prepareOffsets = function (t, event) {
var i, j,
m = $.ui.ddmanager.droppables[t.options.scope] || [],
type = event ? event.type : null, // workaround for #2317
list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(),