Skip to content

Instantly share code, notes, and snippets.

View iansu's full-sized avatar

Ian Sutherland iansu

View GitHub Profile
@april
april / find-all-electron-versions.sh
Last active March 15, 2024 00:56
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
@sindresorhus
sindresorhus / issuehunt-bounties.md
Last active July 5, 2019 08:51
IssueHunt bounties
https://youtu.be/-C-JoyNuQJs?t=39m45s
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
@elnygren
elnygren / index.ts
Last active January 12, 2022 09:44
TypeScript type guard for ensuring / asserting specific optional property
/** Interface with optional properties */
interface IOptionalData {
foo?: { bar?: string };
other?: { bar?: string};
always: { bar?: string };
}
/** Make certain keys of a type required */
type RequiredKeys<T, K extends keyof T> = Exclude<T, K> & Required<Pick<T, K>>
@nickcernis
nickcernis / readme.md
Last active March 7, 2024 01:43
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@anvk
anvk / psql_useful_stat_queries.sql
Last active March 8, 2024 12:05
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@jsonmaur
jsonmaur / bzexcluderules_editable.xml
Last active January 23, 2024 22:32
Backblaze Custom Exclude
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@danihodovic
danihodovic / main.tf
Created January 8, 2017 20:48
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"
@ankurk91
ankurk91 / github_gpg_key.md
Last active March 2, 2024 17:06
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@sid24rane
sid24rane / net.js
Last active February 7, 2024 08:05
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});