Skip to content

Instantly share code, notes, and snippets.

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

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
@navix
navix / readme.md
Last active August 4, 2023 09:02
TypeScript Deep Partial Interface

TypeScript Deep Partial Interface

export type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T);
type DeepPartial = {
@schroedermatt
schroedermatt / programmatic-schema.groovy
Last active December 28, 2018 16:32
Build GraphQL schema programmatically
GraphQLObjectType keeperType = newObject()
.name("keeper") // required
.description("A Zoo Keeper") // optional
.field(newFieldDefinition()
.name("id")
.description("Keeper ID")
.type(GraphQLLong)
.build())
.field(newFieldDefinition()
.name("name")
@clivetyphon
clivetyphon / meraki-client-vpn-linux.md
Created June 15, 2017 09:09
Configuring Meraki Client VPN in Linux

Configuring Meraki Client VPN in Linux

You can try the official Meraki Configuring Client VPN in Linux article for GUI based setup. For terminal based configuration, see below.

Install packages

Install the following packages:

  • strongswan
  • xl2tpd
@johnramsden
johnramsden / arch-linux-basic-surface.md
Last active January 27, 2023 19:33
Basic arch linux install on surface

Arch Linux Install on the Surface Pro 4

From blog post Arch Linux on The Surface Pro 4. Created for Jordi Higuera

If you do have access to a hub, and you have physical access to the machine, letting you plug a keyboard in, you're probably better off using a fresh install ISO. From the Arch Download page download an up to date ISO.

Partitioning

If you've already gone through the steps of shrinking your SSD to give you some extra room on your SSD, once you've booted in to the ISO run lsblk you should see something like this:

@james2doyle
james2doyle / model-update-return.php
Created May 26, 2017 18:11
Update a Laravel Eloquent model and return the fresh model
<?php
// find the model, update the model, give me the fresh model
$updatedUser = tap(User::find(1), function ($user) use ($data) {
return $user->update($data);
})->fresh();
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2025 21:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@belst
belst / rocketguide.md
Last active March 29, 2025 20:35
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@joyrexus
joyrexus / README.md
Last active December 30, 2024 01:37
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@zcaceres
zcaceres / Include-in-Sequelize.md
Last active April 2, 2025 06:07
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@kocisov
kocisov / next_nginx.md
Last active February 3, 2025 07:27
How to setup next.js app on nginx with letsencrypt