Skip to content

Instantly share code, notes, and snippets.

View datio's full-sized avatar
￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸

￸A￸l￸e￸x D￸o￸m￸a￸k￸i￸d￸i￸s datio

￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸ ￸￸
View GitHub Profile
@radiantly
radiantly / noMangleGoogle.user.js
Last active December 28, 2023 04:31
Prevent Google from mangling links on the search results when clicking or copying on Firefox
// ==UserScript==
// @name Prevent link mangling on Google
// @namespace LordBusiness.LMG
// @match https://www.google.com/search
// @grant none
// @version 1.1
// @author radiantly
// @description Prevent google from mangling the link when copying or clicking the link on Firefox
// ==/UserScript==
@StevenACoffman
StevenACoffman / opa-vs-casbin.md
Last active April 7, 2024 02:43
OPA vs Casbin

Information in this Gist originally from this github issue, which is outdated.

As @RomanMinkin mentioned, you can also consider Casbin (https://github.com/casbin/casbin). It is the most starred authorization library in Golang. There are several differences between Casbin and OPA.

Feature Casbin OPA
Library or service? Library/Service Library/Service
How to write policy? Two parts: model and policy. Model is general authorization logic. Policy is concrete policy rule. A single part: Rego
RBAC hierarchy Casbin supports role hierarchy (a role can have a sub-role) Role hierarchies can be encoded in data. Also with the new graph.reachable() built-in function queries over those hierarchies are much more feasible now.
RBAC separation of duties Not supported Supported: two roles cannot be assigned together
@lizlux
lizlux / typescript-menu-aim
Last active April 10, 2021 19:25
Attempt at duplicating Amazon's triangle hover navigation menu
/**
* This plugin attempts to duplicate Amazon's triangle hover navigation menu.
* It's an adaptation of https://github.com/kamens/jQuery-menu-aim, written in Typescript, without jQuery
* See original plugin for documentation
*/
// tslint:disable no-use-before-declare
interface Options {
rowSelector?: string;
@guixxx
guixxx / lrc-autoload.lua
Last active December 1, 2019 22:22
(DEPRECATED) Automatically loads lyric (.lrc) files to mpv if they're found
-- NOTE: This script is no longer necessary as of mpv 0.30.0!
loaded = false
function search_and_load_lrc()
local lrc_path = ext2lrc(mp.get_property("path"))
local file = io.open(lrc_path, "r")
if file ~= nil then
io.close(file)
@cesarandreu
cesarandreu / sensible-defaults.css
Created June 2, 2018 10:04
Sensible css defaults taken from css-layout
div, span {
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
flex-shrink: 0;
align-content: flex-start;
@shabbirbhimani
shabbirbhimani / config.php
Last active November 3, 2018 16:56
How to Enable Debug Mode in XenForo Only for Admins
<?php
//* Do NOT include the opening php tag above. Copy the code shown below.
// Add here your ip.
$debug_ips = array('202.71.5.115');
//For multiple IPs Use this
//$debug_ips = array('202.71.5.115','SOME.OTHER.IP');
if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
#!/usr/bin/env bash
# https://code.google.com/p/chromium/issues/detail?id=226801
url='https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT';
curl -#s "${url}" | \
base64 --decode | \
sed '/^ *\/\// d' | \
sed '/^\s*$/d' > hsts.json;
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active February 17, 2024 23:49
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics