Skip to content

Instantly share code, notes, and snippets.

View danielpza's full-sized avatar
👀

Daniel Perez Alvarez danielpza

👀
View GitHub Profile
#!/bin/bash
echo "##" `date -dmonday -I` "-" `date -dfriday -I`
echo "### Features"
git log --first-parent master --after="`date -dmonday`" --before="`date -dsaturday`" --pretty=format:"- %s" | grep -i "feat" | grep ":" | cut -d' ' -f1,3-
git log --first-parent master --after="`date -dmonday`" --before="`date -dsaturday`" --pretty=format:"- %s" | grep -i "feat" | grep -v ":"
echo "### Fixes"
git log --first-parent master --after="`date -dmonday`" --before="`date -dsaturday`" --pretty=format:"- %s" | grep -i "fix" | grep -iv "feat" | grep ":" | cut -d' ' -f1,3-
@danielpza
danielpza / set-default.sh
Created September 25, 2019 09:19
Set default application for all available mimetype on linux
#!/usr/bin/env bash
# Usage: set-default "app.desktop"
# see https://unix.stackexchange.com/a/361705/233294
set_default() {
d=$1
for m in $(grep MimeType "$d" | cut -d= -f2 | tr ";" " "); do
echo xdg-mime default "$d" "$m"
@danielpza
danielpza / darksouls.ahk
Created August 15, 2020 05:38
Dark Souls autohotkey kick, plunge attack and jump
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; based on https://old.reddit.com/r/darksouls3/comments/4l5kiv/pc_autohotkey_script_for_kickjump_attack/
; and https://steamcommunity.com/app/374320/discussions/0/365163686085275164/?l=spanish&ctp=2
KEYS_TO_CHECK := ["A", "D", "S", "W"]
#!/usr/bin/env sh
# https://stackoverflow.com/a/28085062/6051261
# https://wiki.archlinux.org/title/XDG_Base_Directory#Support
: "${XDG_CONFIG_HOME:=$HOME/.config}"
: "${XDG_CACHE_HOME:=$HOME/.cache}"
: "${XDG_DATA_HOME:=$HOME/.local/share}"
: "${XDG_STATE_HOME:=$HOME/.local/state}"
export XDG_CONFIG_HOME
:tanat
"29.0.50"
#s(hash-table size 97 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("straight" ("2022-06-04 13:31:59" ("emacs") (:type git :host github :repo "raxod502/straight.el" :files ("straight*.el") :branch "master" :package "straight" :local-repo "straight.el")) "org-elpa" ("2022-06-04 13:31:58" nil (:local-repo nil :package "org-elpa" :type git)) "melpa" ("2022-06-04 13:31:59" nil (:type git :host github :repo "melpa/melpa" :build nil :package "melpa" :local-repo "melpa")) "gnu-elpa-mirror" ("2022-06-04 13:31:59" nil (:type git :host github :repo "emacs-straight/gnu-elpa-mirror" :build nil :package "gnu-elpa-mirror" :local-repo "gnu-elpa-mirror")) "el-get" ("2022-06-04 13:31:59" nil (:type git :host github :repo "dimitri/el-get" :build nil :files ("*.el" ("recipes" "recipes/el-get.rcp") "methods" "el-get-pkg.el") :flavor melpa :package "el-get" :local-repo "el-get")) "emacsmirror-mirror" ("2022-06-04 13:31:59" nil (:type git :host github :repo "emacs-straight/emacsmirror-mirror" :build
@danielpza
danielpza / path-mapping.md
Last active December 2, 2022 21:35
Path Mapping Javascript

What is path mapping/path aliases

eg change import {} from '@/some-alias' to import {} from '../../some-alias'

How to do path mapping in javascript

For editor support see https://www.typescriptlang.org/tsconfig#paths

NodeJs Module

import { ComponentType, Suspense } from 'react';
export function withSuspense<T extends {}>(
Component: ComponentType<T>,
Fallback: ComponentType<Partial<T>>
) {
const displayName = Component.displayName || Component.name || 'Component';
function ComponentWithSuspense(props: T) {
return (
@danielpza
danielpza / valheim.ahk
Last active December 27, 2022 22:45
Valheim AHK (requires ahk v2)
#HotIf WinActive("ahk_exe valheim.exe")
sleeptime := 30
SetMouseDelay sleeptime
SetKeyDelay -1, sleeptime
SetDefaultMouseSpeed sleeptime
Wait() {
Sleep(sleeptime)
@danielpza
danielpza / vrising.ahk
Last active May 23, 2023 20:55
V Rising Game ahk v2
#HotIf WinActive("ahk_exe VRising.exe")
sleeptime := 50
SetMouseDelay sleeptime
SetKeyDelay -1, sleeptime
SetDefaultMouseSpeed 0
F9::Reload()
#SuspendExempt
@danielpza
danielpza / fix.sh
Created December 13, 2023 02:48
cloud functions gitignore hack
# HACK seems to be a bug with cloud functions gcloudignore, see https://stackoverflow.com/questions/52976199/gcloudignore-doesnt-allow-standard-wildcard-whitelist/54959530#54959530, https://unix.stackexchange.com/questions/247012/how-to-recursively-remove-all-but-list-of-files
gcloud meta list-files-for-upload >keep
rm -rf node_modules
files_to_delete=$(find . -type f | grep -vFf keep)
rm $(find . -type f | grep -vFf keep)