Skip to content

Instantly share code, notes, and snippets.

@torfjelde
torfjelde / generated_quantities_chains.jl
Last active March 28, 2024 20:03
Converting output from `generated_quantities(model, chain)` into a `MCMCChains.Chains` object
julia> using Turing
julia> include("utils.jl")
julia> @model function demo(xs)
s ~ InverseGamma(2, 3)
m ~ Normal(0, s)
for i in eachindex(xs)
xs[i] ~ Normal(m, s)
end
@allexradu
allexradu / setup.md
Last active March 28, 2024 20:02 — forked from novemberborn/setup.md
OS X Setup virtual hosts on two different ports

Changes with .dev domains in mind.

Step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say :

192.168.0.51
192.168.0.52

To setup the second IP you will have to add a second Ethernet Adapter (logical not physical).

@ondrek
ondrek / gist:7413434
Created November 11, 2013 13:48
Smallest Base64 image
data:image/gif;base64,R0lGODlhAQABAAAAACw=
@miguelmota
miguelmota / README.md
Last active March 28, 2024 19:59
Arch linux secure machine

Create new user

sudo useradd -m -s /bin/bash alice
sudo passwd alice

Add user to wheel (sudo) group

@FrancoNAle
FrancoNAle / imagenes.js
Created March 28, 2024 19:56 — forked from codigoconjuan/imagenes.js
Gist Soporte Imagenes WebP y Avif como Background
(function (document) {
var checkCount = 0,
formatFound = false;
function setHTMLClass(height, className) {
checkCount++;
if (height == 2) {
formatFound = true;
document.documentElement.className += " " + className;
} else {
@codigoconjuan
codigoconjuan / imagenes.js
Created August 4, 2021 21:43
Gist Soporte Imagenes WebP y Avif como Background
(function (document) {
var checkCount = 0,
formatFound = false;
function setHTMLClass(height, className) {
checkCount++;
if (height == 2) {
formatFound = true;
document.documentElement.className += " " + className;
} else {
@rvanbruggen
rvanbruggen / linkedin-query.py
Last active March 28, 2024 19:53 — forked from ThomasCabrol/linkedin-2-query.py
Python script to query your LinkedIn network and get all your network's connections and their interconnections.
#!/usr/bin/env python
# encoding: utf-8
"""
linkedin-query.py
Created by Thomas Cabrol on 2012-12-03.
Customised by Rik Van Bruggen
Copyright (c) 2012 dataiku. All rights reserved.
Building the LinkedIn Graph
@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@mindplay-dk
mindplay-dk / session-life-cycle.md
Last active March 28, 2024 19:52
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@usagimaru
usagimaru / DumpAllMethods.swift
Last active March 28, 2024 19:52
Get all methods of an class or instance in Swift
// Dump all NSApplication’s class methods
let dump = NSApplication.perform(NSSelectorFromString("fp_methodDescription")).takeUnretainedValue() as? String
// Dump all NSApplication’s instance methods
let dump = NSApp.perform(NSSelectorFromString("fp_methodDescription")).takeUnretainedValue() as? String
// or
print(NSApplication.value(forKey: "fp_methodDescription"))
print(NSApp.value(forKey: "fp_methodDescription"))