Skip to content

Instantly share code, notes, and snippets.

@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@TylerTemp
TylerTemp / smaliinjector.py
Last active January 31, 2020 13:41
add Log.e for smail script, for android apk reverse engine debugging
"""
Usage:
smaliinjector [options] inject [<inject_smali_path>] [--exclude=<smali_path>]...
smaliinjector [options] inject [<smali_path>]... [--verbose | --loglevel=<loglevel>]
smaliinjector [options] restore [<restore_smali_path>]...
Options:
-e<smali_path>, --exclude=<smali_path>
exclude folders or files for `inject_smali_path`.
Only works with `inject [inject_smali_path]`
@gsaslis
gsaslis / 3scale_Install.asciidoc
Last active December 18, 2023 19:37
Deploy 3scale API Management on Minishift

Installing 3scale on your Laptop

Pre-requisites

.or your desktop. Or a VM in the cloud. Or wherever it is you want to deploy 3scale to start exploring!
  • ❏ Minishift: 3scale is currently targeted for deployment on openshift, and minishift is the recommended development environment for that.

  • oc command-line tool [optional. you can also use the web-based interface.]

tl;dr

@francis-bitonti
francis-bitonti / index.html
Created November 27, 2018 23:49
Servicebot - Embed Demo - Pricing Embed + Checkout Embed - Francis
<link href="https://fonts.googleapis.com/css?family=Merriweather:300,400,700|Open+Sans:300,400,700" rel="stylesheet">
<div id="servicebot-tiers-embed"></div>
<script src="https://js.stripe.com/v3/"></script>
<script src="https://servicebot.io/js/servicebot-tiers-embed.js" type="text/javascript"></script>
<script type="text/javascript">
Servicebot.Tiers({
templateId : 2,
url : "https://demo2018.serviceshop.io",
selector : document.getElementById('servicebot-tiers-embed'),
@fubarhouse
fubarhouse / loop_files_folders_recursively.go
Last active January 2, 2023 10:31 — forked from francoishill/loop_files_folders_recursively.go
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func run() ([]string, error) {
searchDir := "c:/path/to/dir"
@EvgenyOrekhov
EvgenyOrekhov / A simple Docker and Docker Compose install script for Ubuntu.md
Last active October 6, 2025 03:34
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

@PaulKinlan
PaulKinlan / add-to-homescreen-test.html
Last active September 24, 2020 20:37
iOS Add to Homescreen => simulate web app manifest
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Add to Homescreen</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Test name 2">
@irisli
irisli / callerName.js
Last active July 18, 2023 14:03
JavaScript get caller in strict mode
"use strict";
var stackTrace = (new Error()).stack; // Only tested in latest FF and Chrome
var callerName = stackTrace.replace(/^Error\s+/, ''); // Sanitize Chrome
callerName = callerName.split("\n")[1]; // 1st item is this, 2nd item is caller
callerName = callerName.replace(/^\s+at Object./, ''); // Sanitize Chrome
callerName = callerName.replace(/ \(.+\)$/, ''); // Sanitize Chrome
callerName = callerName.replace(/\@.+/, ''); // Sanitize Firefox
console.log(callerName)
@fitzhaile
fitzhaile / capistrano_wordpress_db_push_pull.rb
Created March 20, 2014 21:23
Push / Pull Wordpress Databases to / from remote and dev environments
namespace :db do
desc "Pull (dump) the remote database and replace the local database with it"
task :pull do
on roles(:app) do
within release_path do
with path: "#{fetch(:path)}:$PATH" do
execute :mysqldump, "-u #{fetch(:wpdb)[fetch(:stage)][:user]} -p\"#{fetch(:wpdb)[fetch(:stage)][:password]}\" -h #{fetch(:wpdb)[fetch(:stage)][:host]} #{fetch(:wpdb)[fetch(:stage)][:name]} > #{fetch(:tmp_dir)}/database.sql"
download! "#{fetch(:tmp_dir)}/database.sql", "database.sql"
execute :rm, "#{fetch(:tmp_dir)}/database.sql"
end
@hofmannsven
hofmannsven / README.md
Last active October 2, 2025 20:17
Git CLI Cheatsheet