Skip to content

Instantly share code, notes, and snippets.

View optikfluffel's full-sized avatar
🤔
mmh..

Udo optikfluffel

🤔
mmh..
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active September 12, 2024 02:10
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@LilithWittmann
LilithWittmann / autobahn.md
Last active October 26, 2023 12:11
autobahn.md
@atomkirk
atomkirk / ecto-url-validation.md
Last active August 4, 2024 03:51
validate url in elixir

Here's an ecto changeset validation for urls:

  @doc """
  validates field is a valid url

  ## Examples
    iex> Ecto.Changeset.cast(%ZB.Account{}, %{"website" => "https://www.zipbooks.com"}, [:website])
    ...> |> Utils.Changeset.validate_url(:website)
    ...> |> Map.get(:valid?)
@qertoip
qertoip / sliding_session_timeout.ex
Last active July 18, 2023 15:33
Elixir / Phoenix Sliding Session Timeout Plug
# How to use it:
#
# Plug it at the end of your :browser pipeline in your Phoenix app router.ex
# Make sure it is plugged before your session-based authentication and authorization Plugs.
#
# pipeline :browser do
# plug :accepts, ["html"]
# plug :fetch_session
# plug :fetch_flash
# plug :put_secure_browser_headers
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active June 24, 2024 02:16
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites

@jeanfbrito
jeanfbrito / influxdb.lua
Created January 6, 2016 18:41
NodeMCU and InfluxDB
-- Your access point's SSID and password
local SSID = "greenhouse"
local SSID_PASSWORD = "senhasupersecreta"
local DEVICE = "device001"
local temperature = 27.5
-- configure ESP as a station
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID,SSID_PASSWORD)
wifi.sta.autoconnect(1)
module PouchDB where
import Task exposing (Task)
import Native.PouchDB
type PouchDB = POUCHDB_IMPLEMENTED_IN_JAVASCRIPT
type PouchError
= Error
@addyosmani
addyosmani / README.md
Last active September 4, 2024 11:40 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@fliiiix
fliiiix / ZFS #FTW
Last active August 29, 2015 14:03
Create FreeBSD tank which can deal with windows filenames
zpool create -O utf8only=on -O normalization=formD -O casesensitivity=mixed -O aclinherit=passthrough tank raidz ada0 ada1 ada2
#receive side
#sudo zfs allow -u l33tname create,receive,rename,mount,share,send tank
sudo zfs allow -l l33tname create,destroy,snapshot,rollback,clone,promote,rename,mount,send,receive,quota,reservation tank
l33tname@travos:~ % zfs allow tank
---- Permissions on tank ---------------------------------------------
Local permissions:
@fdelbos
fdelbos / FreeBSD_node_monit.md
Last active February 17, 2020 13:38
FreeBSD 10 Nodejs setup with nginx, mongo and monit

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb