Skip to content

Instantly share code, notes, and snippets.

View tristanwagner's full-sized avatar
💭

Tristan WAGNER tristanwagner

💭
View GitHub Profile
@MikeyBeLike
MikeyBeLike / ExampleCustomInput.vue
Created March 17, 2021 00:23
Intl-tel-input for Vue 3 using composition API and custom input
<template>
<div class="custom-input">
<label class="custom-input__label" :for="`input-${id}`">
<slot>Input</slot>
</label>
<div class="mt-1">
<input
:id="`custom-input-${id}`"
:type="type"
:required="required"

Some useful custom text objects for vim

Collection of my custom text objects I use quite often.

97975602 6e90ee00 1dda 11eb 9286 6894300457e3

Numbers

Put it into your .vimrc:

@jackkinsella
jackkinsella / .vimrc
Created February 5, 2020 11:17
.vimrc
" Location for installing plugins
call plug#begin('~/.vim/plugged')
" Other plugins are specified with user/repo on Github or x.vim on vimscripts
" Git integration (status bar and commands like Gblame)
Plug 'tpope/vim-fugitive'
" Add info to sidebar about git
Plug 'airblade/vim-gitgutter'
" Add file-management commands like :Delete, :Move, and :Rename
Plug 'tpope/vim-eunuch'
@LiveOverflow
LiveOverflow / asd.py
Last active June 23, 2024 18:52
C Application Firewall
import struct
import socket
s = socket.socket()
s.connect(('127.0.0.1', 1337))
r = s.recv(1024)
s.send("%p,%p,%p\n")
while ',' not in r:
r = s.recv(1024)
start_buf = int(r.split(',')[1], 16)-9
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@eyarz
eyarz / commit-msg-hook.py
Last active December 15, 2021 17:57
Git commit-msg hook to verify commit message convention => https://datree.io/blog/git-commit-message-conventions-for-readable-git-log/
#!/usr/bin/env python
"""
Git commit hook:
.git/hooks/commit-msg
Check commit message according to guidelines
"""
import sys
import re
const sha256 = require('sha256');
class Block {
constructor(index, timestamp, data, prevHash) {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.prevHash = prevHash;
this.thisHash = sha256(
this.index + this.timestamp + this.data + this.prevHash
@scripting
scripting / yamlize.js
Last active September 23, 2018 00:46
Convert between YAML and JSON and vice versa
const utils = require ("daveutils");
const yaml = require ("js-yaml");
function yamlIze (jsontext) {
var jstruct = JSON.parse (jsontext);
const delimiter = "---\n";
var text = jstruct.text;
delete jstruct.text;
var s = delimiter + yaml.safeDump (jstruct) + delimiter + text;
@bragma
bragma / ApiClient.js
Last active December 12, 2023 07:59
My take on 401/token refresh axios interceptor - use promises' implicit queue to retry all pending requests awaiting on a shared promise
import axios from 'axios'
export default class ApiClient {
constructor(baseUrl, tokenStorage) {
this.http = axios.create({
baseURL: baseUrl
})
this.tokenStorage = tokenStorage
this.setupTokenInterceptors()
@ISSOtm
ISSOtm / to_c_or_not_to_c.md
Last active June 22, 2021 12:02
Writeup discussing programming toolchains, coding practices, and languages, for GB and GBC dev.

This document is now at https://gbdev.io/guides/tools.html, please go there instead. It's kept here to avoid breaking links and to preserve history.

Previous versions can be checked out by selecting the "Revisions" tab, and selecting "View file" in the three-dot drop-down menu.