Skip to content

Instantly share code, notes, and snippets.

View ph4un00b's full-sized avatar
:shipit:
0.5 * (1 + srqt(5))

carbon based lifeform ph4un00b

:shipit:
0.5 * (1 + srqt(5))
  • l33t l4mer
  • Latam
  • 17:46 (UTC -06:00)
View GitHub Profile
@ph4un00b
ph4un00b / refactorings.rs
Last active September 28, 2023 20:34
rustic refactorings
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=4c469132823a44a3e014f18c54a0f0a9
for (row_idx, row) in world.floor.clone().iter().enumerate() {
for (col_idx, _value) in row.iter().enumerate() {
if world.floor[row_idx][col_idx] == 0_u8 {
world.floor[row_idx][col_idx] = 7_u8;
}
}
}
@ph4un00b
ph4un00b / phau lang
Last active February 10, 2024 00:42
lang
for queues:
- queue#pop(0)
- queue#pop(-1) // kind of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at
type testing
alias_function@
boolean_function?
named_function(a: 1, b: 3) or named_function({a:1, b: 3})
fn name { return und } or fnr name { und }
@ph4un00b
ph4un00b / commands.txt
Last active April 8, 2024 20:40
terminal hacks docker / unix / windows
|============================= PODMAN / DOCKER =======================|
@see https://unix.stackexchange.com/questions/198590/what-is-a-bind-mount
* ls ~ .docker/
* cat $env:USERPROFILE/.docker/config.json
* docker search nvidia
* docker *image* build -t IMAGE_NAME . *--no-cache*
* docker container run --rm -d [-p 8080:8080 ⭕ --publish mode=ingress,published=8080,target=8080] example/hello-node:latest ✨ in the background
* ✅ docker ps
@ph4un00b
ph4un00b / psql.txt
Created December 5, 2018 18:04
postgresql
\? -> help
create database JAMON; -> create DB | alternative: $ createdb JAMOM
\l -> list db's
drop database JAMON; -> drop DB
\q -> exits
\c JAMON -> switch over DB
\d TABLE? -> describe DB or TABLE
create table NAME(\n column TYPE, ...); -> start modeling table
SERIAL, TEXT -> column types
insert into TABLE(column) values('value'); -> fill the table
:set foldmethod=indent
:set foldlevelstart=20
:set enc=utf-8
:set relativenumber
:set number
:set autoindent
:set expandtab
:set smarttab
:set softtabstop=2
<select id='country-selection'
ng-options="option.name for option in vm.countries track by option.code"
ng-model="vm.selectedCountries"
material-select
multiple
name="country_selection" required>
<option disabled value="">Select visitor country (max 3)</option>
</select>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var jamones = [
{
var jamones = [
{
"id": 3,
"title": "serrano",
"location": "df",
"image": "http://www.hamazing.com/image/cache/data/jamon/serrano/Teruel-Jamon-Serrano-IGP-Organic-Free-Range-712x400.jpg",
},
{
"id": 4,
"title": "pavo",
#include <windows.h>
#include <stdint.h>
#define internal static // just internal for the file? -> translation unit
#define local_persist static
#define global_variable static // automatically initialize to 0
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
@ph4un00b
ph4un00b / gist:5bf3bb7b48f6f656ad66
Last active August 29, 2015 14:11
unix commads to safe my ass
# remove all deleted files
* git ls-files --deleted -z | xargs -0 git rm
# compress directory
$ tar -zcvf project.tar.gz /the/path
# uncompress directory
$ tar -zxvf project.tar.gz