Skip to content

Instantly share code, notes, and snippets.

View clementbiron's full-sized avatar

Clément Biron clementbiron

View GitHub Profile
class HugoAT01364 < Formula
desc "Configurable static site generator"
homepage "https://gohugo.io/"
url "https://github.com/gohugoio/hugo/archive/v0.136.4.tar.gz"
sha256 "839e4545454396d6c6d9a5166151e05fd8f815f36efb2743b9cc7bdb614205f4"
license "Apache-2.0"
head "https://github.com/gohugoio/hugo.git", branch: "master"
depends_on "go" => :build
@clementbiron
clementbiron / alias.html
Last active July 25, 2023 15:36
Maintain Language Preferences on a Hugo Website, small improvment from https://papasmurf.nl/en/blog/hugo_language/
<!DOCTYPE html>
<html {{ with site.LanguageCode | default site.Language.Lang }} lang="{{ . }}"{{ end }}>
<head>
<title>{{ .Permalink }}</title>
<link rel="canonical" href="{{ .Permalink }}">
<meta name="robots" content="noindex">
<meta charset="utf-8">
<noscript>
<meta http-equiv="refresh" content="0; url={{ .Permalink }}"/>
</noscript>
@clementbiron
clementbiron / openfisca-python-api.py
Last active December 13, 2022 09:04
OpenFisca run a simulation
# pip install OpenFisca-Country-Template
from pprint import pprint
from openfisca_core.simulation_builder import SimulationBuilder
from openfisca_country_template import CountryTaxBenefitSystem
tax_benefit_system = CountryTaxBenefitSystem()
entities = {
"persons": {
"_": {
"birth": {
@clementbiron
clementbiron / openfisca-webapi.js
Last active December 12, 2022 16:28
OpenFisca web API
fetch('https://api.demo.openfisca.org/latest/parameter/taxes.income_tax_rate')
.then(response => response.json())
.then(historicalTaxRates => {
for (const [date, taxRate] of Object.entries(historicalTaxRates.values)) {
console.log(`On ${date}, if you earned 100, you paid ${100 * taxRate} in income revenue tax`)
}});
@clementbiron
clementbiron / composer-ssl-error.md
Created October 24, 2018 09:30
Composer open ssl error

When using composer install or composer update i this error :

The "https://wpackagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
  error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
  Failed to enable crypto
  failed to open stream: operation failed

After many hours, i found this solution (on Windows 10, WAMP 3.1.4, Apache 2.4.27, PHP 7.1.9)