Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active June 18, 2024 23:46
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@szemate
szemate / package-lock-conflicts.md
Last active June 13, 2024 15:11
How to resolve package-lock.json conflicts

How to resolve package-lock.json conflicts

It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

  1. Update the master branch with the latest changes:
    git checkout master
    git pull
    
  2. Merge your feature branch into master:
@EndyKaufman
EndyKaufman / CoreClassSerializerInterceptor.ts
Last active January 22, 2024 20:47
CoreClassSerializerInterceptor.ts
import { CallHandler, ClassSerializerInterceptor, ExecutionContext, Injectable, Logger, Module, PlainLiteralObject, SetMetadata, Type } from '@nestjs/common';
import { APP_INTERCEPTOR, Reflector } from '@nestjs/core';
import { ClassTransformOptions, plainToClass } from 'class-transformer';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
export const GQL_RETURN_TYPE = 'GQL_RETURN_TYPE';
export const GqlReturn = (type: Type<any>) => SetMetadata('GQL_RETURN_TYPE', type);
@sondt2709
sondt2709 / octokit-push-commit.js
Created May 11, 2021 18:37
Octokit push commit
// Source: https://dev.to/lucis/how-to-push-files-programatically-to-a-repository-using-octokit-with-typescript-1nj0
const { Octokit } = require('@octokit/rest')
const glob = require('globby')
const path = require('path')
const { readFile } = require('fs-extra')
// org or owner
const ORGANIZATION = process.env.ORGANIZATION
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 20, 2024 23:48
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

@rtfpessoa
rtfpessoa / lazy-load-nvm.sh
Created August 26, 2016 11:42
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
@devynspencer
devynspencer / ansible-github.yml
Last active September 23, 2023 08:37
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 21, 2024 05:12
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);