Skip to content

Instantly share code, notes, and snippets.

View azizzaeny's full-sized avatar
♟️

Aziz Zaeny azizzaeny

♟️
View GitHub Profile
@anildigital
anildigital / cleanup_swap.md
Last active May 14, 2024 08:28
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver 
# Alfresco users
curl -s -u user:pass http://localhost:8080/alfresco/service/api/people | jq '.people[] .userName'
curl -s -u user:pass http://localhost:8080/alfresco/service/api/people | jq '.people[] | "\(.userName),\(.firstName),\(.lastName),\(.email)"'
# Alfresco groups
curl -s -u user:pass http://localhost:8080/alfresco/service/api/groups | jq '.data[] .shortName'
curl -s -u user:pass http://localhost:8080/alfresco/service/api/groups | jq '.data[] | "\(.shortName),\(.fullName),\(.displayName)"'
@olih
olih / jq-cheetsheet.md
Last active May 15, 2024 22:26
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@galek
galek / pbr.glsl
Created November 4, 2015 11:10
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@martintrojer
martintrojer / queries.clj
Created July 16, 2012 12:16
Datomic queries in core.logic
(ns queries
(:refer-clojure :exclude [==])
(:use [clojure.core.logic])
(:use [datomic.api :only [q]]))
(defn query [rule xs]
(let [prule (prep rule)]
(map #(binding-map* prule (prep %)) xs)))
;; ---