Skip to content

Instantly share code, notes, and snippets.

View Vicfred's full-sized avatar
:octocat:
I like mathemagic and computering

Vicfred Vicfred

:octocat:
I like mathemagic and computering
View GitHub Profile
@Vicfred
Vicfred / zig.md
Last active June 26, 2023 02:39
zig tricks

read int

const std = @import("std");

pub fn main() !void {
    const stdout = std.io.getStdOut();
    const reader = std.io.getStdIn().reader();

    var buffer: [1024]u8 = undefined;
 while (try reader.readUntilDelimiterOrEof(&buffer, '\n')) |line| {
@Vicfred
Vicfred / exifcamera.md
Last active October 18, 2023 03:52
camera exif data metadata

Add or substract X hours to photo's date

exiftool -alldates+=X -filemodifydate+=X -filecreatedate+=X -overwrite_original *.JPG

Change photo modification date to match exif timestamp

exiv2 -T rename *.jpg
@Vicfred
Vicfred / lock.sh
Last active March 13, 2023 07:18
scripts
#!/bin/sh
BLANK='#00000000'
CLEAR='#ffffff22'
DEFAULT='#ff00ffcc'
TEXT='#ee00eeee'
WRONG='#880000bb'
VERIFYING='#bb00bbbb'
i3lock \
@Vicfred
Vicfred / pelican.md
Created January 30, 2023 05:03
pelican static site
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install pelican
pip freeze > requirements.txt
git init
@Vicfred
Vicfred / ss.sh
Created January 16, 2023 01:22
scrot xclip selection clipboard
#!/bin/sh
scrot '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f' -s
@Vicfred
Vicfred / lock.sh
Created January 16, 2023 01:19
i3lock-color example
#!/bin/sh
BLANK='#00000000'
CLEAR='#ffffff22'
DEFAULT='#ff00ffcc'
TEXT='#ee00eeee'
WRONG='#880000bb'
VERIFYING='#bb00bbbb'
i3lock \
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us"
Option "XkbModel" "pc105"
Option "XkbOptions" "compose:ralt,caps:swapescape"
Option "AutoRepeat" "3000 25"
EndSection
@Vicfred
Vicfred / rc.lua
Last active August 29, 2022 08:03
awesome
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
@Vicfred
Vicfred / allstrings.cpp
Created August 1, 2022 03:12
allstrings.cpp
set<string> valid{"a", "b", "c", "?"};
for(const auto& i : valid) {
for(const auto& j : valid) {
for(const auto& k : valid) {
for(const auto& l : valid) {
for(const auto& m : valid) {
for(const auto& n : valid) {
for(const auto& o : valid) {
string str = i + j + k + l + m + n + o;
good.insert(str);
@Vicfred
Vicfred / .config
Created July 24, 2022 08:18
maggie, nvidia, intel, tuneado en #gentoo
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.18.12-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo 11.3.0 p5) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23700