Skip to content

Instantly share code, notes, and snippets.

View shaunmolloy's full-sized avatar

Shaun Molloy shaunmolloy

View GitHub Profile
@sairajchouhan
sairajchouhan / cbugger.lua
Last active September 22, 2023 09:52
lua script to insert logs in javascript for neovim
M = {}
local num = 0;
M.setup = function()
vim.api.nvim_set_keymap('n', '<leader>cl', ':Cbugger<CR>', { noremap = true, silent = true })
vim.api.nvim_create_user_command("Cbugger", function()
local cursor = vim.api.nvim_win_get_cursor(0);
local final_str = "console.log(`" .. num .. ": ";
@khushal87
khushal87 / blog3.md
Last active July 5, 2024 21:37
Linking a custom domain from Google domains to Vercel app

Linking a custom domain to a deployed application is confusing and at times you don't get a route on how to link the domain with the website. 😫

In this article, I will be explaining how to link a Custom domain brought in Google Domains service to an application hosted on Vercel.

Perks of using vercel is that it allows adding domain without any verification unlike Heroku/Netlify, which means you don't have to add your billing details to add a domain to your application. Moreover, it is fast, efficient, and easy to use.😁

What is Vercel?

​Vercel is a deployment and collaboration platform for frontend developers. ​Vercel enables developers to host websites and web services that deploy instantly and scale automatically – all without any configuration. Source - Official Docs

@siiramone
siiramone / download_sentry_data.py
Last active November 16, 2023 19:32 — forked from vladox/download_sentry_data.py
Download sentry issues within the specified date range for a project. Useful for data processing.
"""Download sentry data.
usage:
1. create auth token (https://sentry.io/settings/account/api/auth-tokens/).
2. make a directory for export if not exists.
$ mkdir data
3. fix event.timestamp (L27).
4. execute
$ python download_sentry_data.py <org>/<project> <auth_token>
5. a CSV file with a name formatted as "./data/issues_YYYYmmDDHHMMSS.csv" is created.
"""
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active June 9, 2024 07:46
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@krisleech
krisleech / renew-gpgkey.md
Last active July 10, 2024 14:14
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@chusiang
chusiang / teams-chat-post-for-workflows.sh
Last active July 23, 2024 12:38
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post-for-workflows.sh
# Modified: 2024-07-22 11:44 (UTC+08:00)
# Description: Post a message to Microsoft Teams via "Post to a chat when a webhook request is received" workflows.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
# - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
# Companies currently using Go throughout the world
## United States
* [Google](http://google.com/) - the core Go team work at Google. Most uses of Go at Google are confidential.
* [Kubernetes](http://kubernetes.io/)
* The [YouTube](http://youtube.com/) team have released their [MySQL scaling infrastructure](http://vitess.io/) as open source software [1](https://www.youtube.com/watch?v=5yDO-tmIoXY), [2](https://www.youtube.com/watch?v=qATTTSg6zXk), [3](https://www.youtube.com/watch?v=midJ6b1LkA0&sns=gp)
* dl.google.com is written in Go: [mailing list discussion](https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/BNUNbKSypE0) / [OSCON slides](http://talks.golang.org/2013/oscon-dl.slide#1)
* [Flywheel: Google's Data Compression Proxy for the Mobile Web](http://research.google.com/pubs/pub43447.html), [blog post on the rewrite](http://matt-welsh.blogspot.co.uk/2013/08/rewriting-large-production-system-in-go.html)
* [A lot of scripts that earlier were written in Sawzall](http:
@craigdmckenna
craigdmckenna / sqlalchemy_mysql_binary_uuid.py
Last active January 15, 2023 21:22
SQLAlchemy, MySQL 16 bit UUID, Custom Data Type
import UUID
from sqlalchemy.dialects.mysql import BINARY
from sqlalchemy.types import TypeDecorator
class BinaryUUID(TypeDecorator):
'''Optimize UUID keys. Store as 16 bit binary, retrieve as uuid.
inspired by:
http://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/
@gedex
gedex / woocommerce-shipment-tracking-rest-api-doc.md
Last active March 21, 2020 09:05
WooCommerce Shipment Tracking REST API introduced in 1.5.0

Shipment Tracking REST API

The shipment tracking REST API allows you to create, view, and delete individual shipment tracking. The endpoint is /wp-json/wc/v1/orders/shipment-trackings.

Shipment Tracking Properties

Attribute Type Description
tracking_id string Unique identifier for shipment tracking read-only
tracking_number string Tracking number required
@nateware
nateware / make_favicon.sh
Last active June 27, 2024 16:02
Imagemagick to create favicon.ico with 16x16 and 32x32 sizes in it
# IE is still braindead so still use favicon.ico
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico
convert output-16x16.ico output-32x32.ico favicon.ico
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32">