Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
@ianks
ianks / slugify.sql
Last active April 24, 2025 00:00
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
// APIStoreProps are properties that need to be
// ignored when running APIStore.makeStore()
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state']
// getMethods returns methods defined
// in a given class' prototype, except init and constructor
const getMethods = (cls) => {
return Object.getOwnPropertyNames(cls.prototype)
.reduce((obj, prop) => {
@osopolar
osopolar / com.user.time-machine-exclude-node-modules-job.plist
Last active March 25, 2026 09:21 — forked from peterdemartini/command.sh
Exclude node_modules (and more) from timemachine, use launchd to scan the Project directory on a regular basis, for example meanwhile you are having siesta. Put this file in ~/Library/LaunchAgents and call `launchctl load ~/Library/LaunchAgents/com.user.time-machine-exclude-node-modules-job.plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.time-machine-exclude-node-modules-job</string>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
@izzygld
izzygld / WP-Graphql-Nav-Menu-Readme.md
Last active July 18, 2023 17:04
WP-Graphql Nav Menu Documentation

WP Grahql - Nav Menu

Implements navigation menu support with two new types: Menu and MenuItem. Each have singular and plural root queries. MenuItems are connected to both Menus and to themselves—this allows for the implementation of childItems (hierarchical nav menu queries):

Query{
  menus( location: MAIN ) {
    edges {
      node {
        id

Nix Flake MVP

Goals

  • To provide Nix repositories with an easy and standard way to reference other Nix repositories.

  • To allow such references to be queried and updated automatically.

  • To provide a replacement for nix-channel, NIX_PATH and Hydra

@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active June 11, 2026 19:55
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@PierreCavalet
PierreCavalet / passport.md
Created December 10, 2018 07:25
Authentification avec Passport.js

Authentification avec Passport.js

Passport.js est un middleware permettant de gérer l'authentification. Il s'intègre très bien avec Express.js. L'authentification est le processus de vérification qu'un utilisateur est bien celui qu'il prétend être.

Notre système d'authentification utilisera un JSON web token.

Comprendre ce qu'est un JSON web token (JWT)

Un JWT permet à un utilisateur de certifier certaines informations. Il est composé de 3 parties:

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active August 1, 2026 05:21
Conventional Commits Cheatsheet
@jasonbahl
jasonbahl / filter-fields-to-require-auth.php
Last active April 9, 2020 16:30
Shows how to filter fields in the WPGraphQL Schema to require authentication before resolving.
add_action( 'graphql_register_types', function() {
/**
* Define the Types and their Fields that we want to filter
*/
$fields_to_require_auth = [
'Post' => [
'author'
],
'Comment' => [
<script>
export default {
props: {
span: {
type: String,
default: null
}
},
render: function (createElement) {
return createElement(