Skip to content

Instantly share code, notes, and snippets.

View HighLiuk's full-sized avatar
🏠
Working from home

Luca Di Fazio HighLiuk

🏠
Working from home
  • Idearia Srl
  • Rome
  • 18:28 (UTC +01:00)
View GitHub Profile
@HighLiuk
HighLiuk / example.ts
Last active January 3, 2024 11:24
WP Hooks with TypeScript
type Events = {
hook_1: string[];
hook_2: number;
};
const { addFilter, applyFilters } = new Filter<Events>();
addFilter('hook_1', callback)
// ^ autocomplete on event names
// ^ static analysis on callback functions based on the specific event
@amoutonbrady
amoutonbrady / remove_ts.md
Created November 3, 2018 21:04
Regex to remove tsc --init default config comments
  1. Go into VSCode
  2. Install typescript npm i typescriptfor local OR npm i -g typescript for global
  3. Run either node_modules/.bin/tsc --init for local installation or tsc --init for global
  4. Open the generated file tsconfig.json and press CTRL+F
  5. Make sure to tick the regex filter for search on the far right of the search input (third icon)
  6. Pase that regex \s* \/\* .* \*\/
  7. Replace by "nothing"
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote