Skip to content

Instantly share code, notes, and snippets.

@davidalves1
davidalves1 / desfazendo-push.md
Last active May 3, 2024 18:38
Desfazendo um git push

Desfazendo um git push

Não é possível desfazer um push diretamente, como é feito com o commit utilizando o comando $ git reset --soft|mixed|hard hash-do-penultimo-commit

Para desfazer um push são necessários 3 passos:

  1. Utilizar o comando $ git reset --mixed HEAD~1 e em seguida utilizar o comando $ git stash (se preferir pode usar a opção -m "revertendo o push blablabla" para salvar o stash com um contexto do que foi feito
  2. Utilizar o comando $ git revert HEAD~0
  3. Utilizar o comando $ git stash apply
  4. Utilizar o comando $ git push origin sua-branch -f
@rphlmr
rphlmr / helpers.ts
Last active May 3, 2024 18:37
Drizzle ORM, deep sub queries
/* -------------------------------------------------------------------------- */
/* More here; */
/* -------------------------------------------------------------------------- */
//gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
https: export function distinctOn<Column extends AnyColumn>(column: Column) {
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`;
}
export function jsonBuildObject<T extends SelectedFields>(shape: T) {
@CHFR-wide
CHFR-wide / ease_copy_1.0.3.lua
Last active May 3, 2024 18:36
Script for saving and applying easing presets within davinci fusion
-- Easecopy v1.0.3
-- Changelog:
-- v1.0.3 : Makes the script composition-agnostic
-- v1.0.2 : Fixes an issue where number-only ease names would crash the script
----------------------
-- UI_MANAGER SETUP --
----------------------
@hfiref0x
hfiref0x / akagi_41.c
Created August 16, 2017 03:31
UAC bypass using CMSTPLUA COM interface
typedef interface ICMLuaUtil ICMLuaUtil;
typedef struct ICMLuaUtilVtbl {
BEGIN_INTERFACE
HRESULT(STDMETHODCALLTYPE *QueryInterface)(
__RPC__in ICMLuaUtil * This,
__RPC__in REFIID riid,
_COM_Outptr_ void **ppvObject);
@0xjac
0xjac / private_fork.md
Last active May 3, 2024 18:34
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@guvener
guvener / tw-background-hex.md
Created April 30, 2022 08:46
Tailwind background colors HEX codes
@scientificRat
scientificRat / keymap.py
Last active May 3, 2024 18:31
Use raspberry pi as Bluetooth HID mouse/keyboard emulator
#
# Taken from https://www.gadgetdaily.xyz/create-a-cool-sliding-and-scrollable-mobile-menu/
#
# Convert value returned from Linux event device ("evdev") to a HID code. This
# is reverse of what's actually hardcoded in the kernel.
#
# Lubomir Rintel <lkundrak@v3.sk>
# License: GPL
#
# Ported to a Python module by Liam Fraser.
@madskjeldgaard
madskjeldgaard / supercollider2live.scd
Last active May 3, 2024 18:30
SuperCollider to Ableton Live setup

/*

This small patch is an example of how to nicely send midi to Ableton Live from SuperCollider.

It includes how to set up Ableton Link (don't forget to press the "LINK" button in Live) and play a pattern using Link and midi.

It is assumed that you do this on MacOS and you have created a midi driver called "IAC Driver".

*/ (

@SRatna
SRatna / Top 50 Universities List.md
Created April 29, 2018 03:27
Top 50 Computer Science Universities

Universities

Massachusetts Institute of Technology (MIT)

###phd###

  • MIT Graduate Admissions link
  • PhD Program - MIT Sloan School of Management link
  • MIT - Massachusetts Institute of Technology link
  • to view contact information for all departments. - MIT link
@munim
munim / set-ip.md
Last active May 3, 2024 18:26
Set network IP Static/DHCP using Powershell

#How to set network IP Static/DHCP using Powershell in Windows 8 and above

This is a powershell script to set IP address for a network adapter using Powershell and restart the network adapter after it completes. Follow the below steps and detailed information about the parameters below.

Create a ps1 file using the below code

# Author: Munim (me@munim.net)