Skip to content

Instantly share code, notes, and snippets.

View metruzanca's full-sized avatar

Sam Zanca metruzanca

View GitHub Profile
@metruzanca
metruzanca / conky.conf
Created August 19, 2019 10:06
My conky config file
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[commentsssss]]
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'gray',
default_outline_color = 'red',

Keybase proof

I hereby claim:

  • I am metruzanca on github.
  • I am metruzanca (https://keybase.io/metruzanca) on keybase.
  • I have a public key ASBFmlVYCYF5Q2bVI217iWIuHrZl7Tf7QBsMXxBeuvAq4go

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@metruzanca
metruzanca / typescript-react-gatsby.code-snippets
Last active December 29, 2020 02:31
VSCode Snippets I use
{
"Gatsby Function Component": {
"prefix": "gfc",
"body": [
"import React from \"react\"",
"import { useStaticQuery, graphql } from \"gatsby\"",
"",
"// import {} from './styles'",
"",
"interface Props {",
FROM python:3.8-slim
# Install dependencies: ffmpeg & git
RUN apt-get -y update; \
apt-get -y upgrade; \
apt-get install -y ffmpeg; \
apt-get install -y git
# Manual install ytmdl (https://github.com/deepjyoti30/ytmdl)
RUN pip install setuptools; \
const fs = require('fs');
const meta = require('./config.json')
// Cannot use classes for some reason. Using prototypal inheritance
module.exports = function Fs({tp, cwd = process.cwd()}) {
if(!tp) return 'tp is required for Fs'
this.tp = tp
this.vaultRoot = cwd + meta.vault.path
/**

Rip, CORS in discord's console :(

This doesn't work, like I feared.

Usage

Paste this into the discord console

fetch("https://api.github.com/gists/81b426f83604964ad6935b99693eec97")
  .then(d => d.json())
 .then(d => eval(d.files['tally.js'].content))
@metruzanca
metruzanca / readme.md
Last active August 14, 2021 00:43
Nodejs create release script

Usage

  1. Install dependencies
npm i -D inquirer chalk exec-sh ts-node
  1. Add this structure to your package.json and include all file paths that have a version key that you want to modify.

This assumes version key in the first level of the jsons.

@metruzanca
metruzanca / goErrors.ts
Last active March 10, 2022 07:42
Async/Await error handling using a golang inspired pattern.
const isPromise = <T = any>(promise: any): promise is Promise<T> => promise.constructor.name === 'Promise'
type Error = {
type: 'error';
error: any;
};
type Success<R> = {
type: 'success';
{
"$schema": "https://solid-resume.vercel.app/schema.json",
"meta": {
"canonical": "https://gist.github.com/metruzanca/751361e5ba58ad06f361ebd430ae6e10",
"version": "v1.0.0",
"lastModified": "2023-09-27T23:05:38.760Z",
"theme": "actual"
},
"basics": {
"name": "Samuele Zanca",