Skip to content

Instantly share code, notes, and snippets.

View aneutron's full-sized avatar
🐢
Learning stuff and breaking things

Ayoub Boudhar aneutron

🐢
Learning stuff and breaking things
View GitHub Profile
<?php
function base_url(){
$base_url = is_https() ? 'https' : 'http';
$base_url .= '://'.$_SERVER['HTTP_HOST'].str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
return $base_url;
}

Keybase proof

I hereby claim:

  • I am aneutron on github.
  • I am ayoubboudhar (https://keybase.io/ayoubboudhar) on keybase.
  • I have a public key ASAZIgq1ZaAf6HkowJv-T9fKx9LitmVXqC93MZmhicbuggo

To claim this, I am signing this object:

function [t a prob] = MH_routine(theta,p,proposal_PDF,sample_from_proposal_PDF)
% Metropolis-Hastings algorithm routine:
theta_ast = sample_from_proposal_PDF(theta); % sampling from the proposal PDF with media the current state
alpha = (p(theta_ast)*proposal_PDF(theta,theta_ast))/... % Ratio of the density at the
(p(theta) *proposal_PDF(theta_ast,theta)); % candidate (theta_ast) and current (theta) points
if rand <= min(alpha,1)
t = theta_ast; % Accept the candidate
prob = min(alpha,1); % Accept with probability min(alpha,1)
a = 1; % Note the acceptance
h1. Microsoft Azure
Groups 8 and 14.
h2. For the database
|_. Type Name |_. VCPUs |_. RAM (GB) |_. Disk (GB) |_. Cost (Euro) |_. 1 YEAR RESERVED[% SAVINGS] |_. 3 YEAR RESERVED[% SAVINGS] |
|_.Type A|=.4|=.8|=.500||||
|=.A4 v2|=.4|=.8|=.40|=.112,97€/mois|||
|=.A3|=.4|=.7|=.120|=.125,93€/mois|||
|=.D4 v3|=.4|=.16|=.100|=.128,16€/mois|=.94,10 €/mois (~36%)|=.64,82 €/mois (~56% SAVINGS)|
@aneutron
aneutron / x.md
Created December 23, 2017 22:21 — forked from vjeux/x.md
Ocaml / functional programming

I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Jeu 01 Mars 2018 à 09:28
-- Version du serveur: 5.5.50-0ubuntu0.14.04.1-log
-- Version de PHP: 5.5.9-1ubuntu4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@aneutron
aneutron / sus_posix_infos.txt
Created March 5, 2018 00:35 — forked from u1735067/sus_posix_infos.txt
Notes about POSIX & Single Unix Specification
Infos
https://en.wikipedia.org/wiki/Single_UNIX_Specification
https://github.com/geoff-codes/posix-unix-standard
https://mywiki.wooledge.org/POSIX
Single Unix Specification, SUS (T101) = "Base Specifications" POSIX-2008 (C165) (+ X/Open Curses (C094)) (??)
http://www.cse.psu.edu/~deh25/cmpsc311/Lectures/Standards/PosixStandard.html
"SUS"
https://publications.opengroup.org/t101
http://pubs.opengroup.org/onlinepubs/9699919799/
@aneutron
aneutron / audit.rules
Created October 31, 2018 10:13 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@aneutron
aneutron / compress-pdf-with-gs.md
Created February 9, 2019 10:28 — forked from drawveloper/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.