Skip to content

Instantly share code, notes, and snippets.

@nowl
nowl / perlin.c
Created February 15, 2011 19:04
Perlin Noise in C
#include <stdio.h>
static int SEED = 0;
static int hash[] = {208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40,
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204,
9,92,217,54,239,174,173,102,193,189,190,121,100,108,167,44,43,77,180,204,8,81,
70,223,11,38,24,254,210,210,177,32,81,195,243,125,8,169,112,32,97,53,195,13,
203,9,47,104,125,117,114,124,165,203,181,235,193,206,70,180,174,0,167,181,41,
164,30,116,127,198,245,146,87,224,149,206,57,4,192,210,65,210,129,240,178,105,
@Pandry
Pandry / Firewalld GeoIP firewall script
Last active May 2, 2024 20:18
Block countries IPs via Firewalld
#!/bin/bash
##
# Name: GeoIP Firewall script
# Author: Pandry
# Version: 0.1.1
# Description: This is a simple script that will set up a GeoIP firewall blocking all the zones excecpt the specified ones
# it is possible to add the whitelisted zones @ line 47
# Additional notes: Usage of [iprange](https://github.com/firehol/iprange) is suggested
# for best performances
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Cube Renderer</title>
<style>
body {
margin: 0;
padding: 0;
@oianmol
oianmol / platform.android.kt
Created May 19, 2023 10:01
Jetpack Compose Side Effect to update Android or iOS status-bar and navigation-bar color
@Composable
actual fun PlatformColors(statusBarColor: Color, navBarColor: Color){
val sysUiController = rememberSystemUiController()
SideEffect {
sysUiController.setSystemBarsColor(color = topColor)
sysUiController.setNavigationBarColor(color = bottomColor)
}
}
[
{ code: 'AD', label: 'Andorra', phone: '376', phoneLength: 6},
{ code: 'AE', label: 'United Arab Emirates', phone: '971', phoneLength: 9},
{ code: 'AF', label: 'Afghanistan', phone: '93', phoneLength: 9},
{ code: 'AG', label: 'Antigua and Barbuda', phone: '1-268', phoneLength: 10},
{ code: 'AI', label: 'Anguilla', phone: '1-264', phoneLength: 10},
{ code: 'AL', label: 'Albania', phone: '355', phoneLength: 9},
{ code: 'AM', label: 'Armenia', phone: '374', phoneLength: 6},
{ code: 'AO', label: 'Angola', phone: '244', phoneLength: 9},
{ code: 'AQ', label: 'Antarctica', phone: '672', phoneLength: 6},
@lgg
lgg / readme.md
Last active May 2, 2024 20:14
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.

@aizazahmed-emumba
aizazahmed-emumba / Install.txt
Created May 2, 2024 19:59 — forked from choco-bot/Install.txt
nero-aac v1.5.4 - Failed - Package Tests Results
==> default: Running provisioner: shell...
[ERROR] An error occurred in the underlying SSH library that Vagrant uses.
[ERROR] The error message is shown below. In many cases, errors from this
[ERROR] library are caused by ssh-agent issues. Try disabling your SSH
[ERROR] agent or removing some keys and try again.
[ERROR] If the problem persists, please report a bug to the net-ssh project.
[ERROR] timeout during server version negotiating
@katef
katef / life-utf8.c
Last active May 2, 2024 20:13
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*
[
"928350122843193385",
"1185047194261274665",
"956202276408688650",
"956104664821157918",
"1185047092478095443",
"1185046791826178099",
"1185047045413797898",
"928483283698851901",
"1185047444619284641",
@jakeweidokal
jakeweidokal / Obsidian Daily Note Template.md
Last active May 2, 2024 20:12
This is Jake Weidokal's template for creating daily notes in Obsidian.
week tags
<% tp.date.now('ww',0, tp.file.title, 'YYYY-MM-DD') %>
daily

<% tp.web.daily_quote() %>

<% tp.date.now("dddd, MMMM Do YYYY", 0, tp.file.title, "YYYY-MM-DD") %>

[[ <% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %> |⬅️ Yesterday]] | [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>|➡️ Tomorrow]] | [[<% tp.date.now("YYYY-[w]WW", 0, tp.file.title, "YYYY-MM-DD") %>|📖 Weekly]] | [[<% tp.date.now("YYYY-MM", 0, tp.file.title, "YYYY-MM-DD") %>|📅 Monthly]]