Skip to content

Instantly share code, notes, and snippets.

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

Dan LaManna danlamanna

🏠
Working from home
View GitHub Profile
@danlamanna
danlamanna / create-gh-pr.sh
Last active February 16, 2021 16:55
Create and merge a GH PR automatically
#!/usr/bin/env bash
set -euo pipefail
MERGE_WHEN_CHECKS_PASS=0
VIEW_IN_WEB=0
if ! [ -x "$(command -v gh)" ]; then
echo 'Error: gh is not installed.' >&2
exit 1
fi
@elalemanyo
elalemanyo / README.md
Last active October 9, 2024 08:47
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.

// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@chylex
chylex / filter.txt
Created May 25, 2018 14:04
uBlock Origin - Google search - Remove "People also search for"
! https://www.google.com/search
www.google.com##.exp-outline
www.google.com##[style="display: block; opacity: 1;"]
www.google.com##[data-hveid]>div:style(height: auto !important)
@andyrbell
andyrbell / scanner.sh
Last active November 3, 2024 13:42
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
let authRequestExtras = {
code_challenge: this._verifier.challenge,
code_challenge_method: this._verifier.method
}
let authResponse = this.authorizationHandler.performAuthorizationRequest(this.configuration, new AuthorizationRequest(
clientId, redirectUri, scope, AuthorizationRequest.RESPONSE_TYPE_CODE,
undefined /* state */, authRequestExtras));
let tokenRequestExtras = = { code_verifier: this._verifier.verifier };
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@leucos
leucos / do_boot2.sh
Last active December 26, 2023 17:54
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory (version for Ansible v2.0+ and DO API v2.0)
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.
@martijnvermaat
martijnvermaat / gitlab-ipython-notebook.md
Last active May 8, 2023 00:53
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).