Skip to content

Instantly share code, notes, and snippets.

View sgtrusty's full-sized avatar
💭
happy im heeeere

Santiago González sgtrusty

💭
happy im heeeere
View GitHub Profile
@LSLeary
LSLeary / ConditionalBindings.hs
Last active October 4, 2022 01:27
Conditional key bindings for xmonad. WIP.
{-# LANGUAGE StandaloneDeriving, DeriveFunctor, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
--------------------------------------------------------------------------------
-- Module : XMonad.Actions.ConditionalBindings
-- Description : A framework for producing conditional key bindings.
-- Copyright : (c) 2018 L. S. Leary
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : L. S. Leary
@Lycan47
Lycan47 / zookeeper.py
Created October 21, 2020 16:23
This short code challenge can help the local zoo look after its denizens.
camel = r"""
Switching on the camera in the camel habitat...
___.-''''-.
/___ @ |
',,,,. | _.'''''''._
' | / \
| \ _.-' \
| '.-' '-.
| ',
| '',
@swyxio
swyxio / Tailwindcssunreset.scss
Last active February 14, 2024 01:19
Tailwind CSS Un-Reset - un-reset Tailwind's Preflight CSS Reset so that autogenerated HTML looks consistent with the rest of your Tailwind site. - https://www.swyx.io/writing/tailwind-unreset
.unreset {
a {
@apply text-blue-700 underline;
}
p {
@apply my-4;
}
blockquote,
figure {
@schnerd
schnerd / lazy-load-puppeteer.js
Created April 18, 2018 03:21
Lazy-loading content in Puppeteer
function wait (ms) {
return new Promise(resolve => setTimeout(() => resolve(), ms));
}
export default async function capture(browser, url) {
// Load the specified page
const page = await browser.newPage();
await page.goto(url, {waitUntil: 'load'});
// Get the height of the rendered page
@SKempin
SKempin / Git Subtree basics.md
Last active February 28, 2025 06:58
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@mjrousos
mjrousos / BasicMiddleware.cs
Last active April 13, 2021 21:47
CustomMiddleware
// The middleware delegate to call after this one finishes processing
private readonly RequestDelegate _next;
public SOAPEndpointMiddleware(RequestDelegate next)
{
_next = next;
}
@dogfuntom
dogfuntom / Vim Ideas.md
Last active January 10, 2024 14:40
cheat sheet about registers and marks in vim emulators #vs #vim #vsvim #vsc

Finding opportunities to apply advanced Vim

When it comes to Vim emulators, how to do an advanced operation is not the hard part. The hard part is remembering/recognizing that some routine operation can be helped by Vim.

Log method call

Useful for understanding sloppily/poorly written legacy code. Given a bunch of methods like this:

private void ConfusinglyNamedAndConfusinglyUsedMethod()

@leonardofed
leonardofed / README.md
Last active March 14, 2025 18:19
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@vladikoff
vladikoff / doskey.md
Last active January 30, 2025 07:39
Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Saved from Archive.org, Date: May 14, 2010 Author: Jesse Webb

http://web.archive.org/web/20140330024520/http://devblog.point2.com/2010/05/14/setup-persistent-aliases-macros-in-windows-command-prompt-cmd-exe-using-doskey/

Our development machines here at Point2 are not standardized; we have a mixture of Windows XP, 7, and Mac OSX/Unix computers. I find myself constantly switching back and forth between command prompt interfaces when pair programming. As a result, I catch myself using “ls” to list a directories contents regardless of what system I am on. I am currently using a Windows XP machine for my developer box and I wanted to setup an alias to the “ls” command to actually perform a “dir”. Here is how I accomplished it…

There is a command available in a Window’s shell that let’s you “alias” command to whatever you please: DOSKey. It allows you to create “macros” to execute one or more other commands with a custom nam