Skip to content

Instantly share code, notes, and snippets.

@jumski
jumski / setup.md
Created January 21, 2019 16:15 — forked from jdesive/setup.md
Mount NFS share from synology NAS to Ubuntu

Mount Synology NFS share to Ubuntu 16.04

I have all hardware virtualized in ESXi 6.5...
Synology DSM 5.2-5644
Ubuntu 16.04

Start

On your fresh install on Ubuntu 16.04:

  1. Click the Connections icon on the top bar
  2. Goto Edit Connections
@onselakin
onselakin / tf-module.md
Created March 18, 2023 12:10
Creating a Terraform module with Jarvis (ChatGPT)

Azure Blob Storage Config.

Started on: 3/18/2023, 10:33:07 AM


Önsel:

Let's create a terraform config for Azure. Give me a terraform code for creating a secure blob storage first.

Jarvis:

Grammar of Kitten

This is an annotated EBNF grammar of the latest rewrite of Kitten. Items marked with a dagger (†) are explained in the surrounding prose, not in EBNF.

Source Locations

The source column of a token is the offset to its first character within the line in which it appears. The indentation of a line is the source column of the first token in the line. Tab characters are illegal.

Layout

@paseaf
paseaf / code_smells_and_solutions.md
Last active April 26, 2024 08:08
Code Smells and Solutions

Definition (Code Smells) Code smells are common code anti-patterns which could and should be refactored.

This doc is summarized from Martin Flower's book Refactoring (the 2nd Edition).

Refactoring is all about Change

  • You may inverse previous refactorings as software grows
  • You may change names of a function/parameter/varible/... as you learn

How to use this doc

Go to a section of code smell, and the refactoring techniques to that smell are written in Pascal Case under the Solution section. Refer to the book's catalog to get detailed examples and explainations for each refactoring technique.

Table of Code Smells

Guide for building a ppzkpcd constraint system

Before reading this guide, you should get familar with definition of proof of carrying data. Section 5 of [BCCT13] gives a formal definition.

This guide is mainly based on the source file in zk_proof_systems/pcd/r1cs_pcd/compliance_predicate/. You can use the source files example/tally.hpp and example/tally.tcc as sample.

You need do define 5 classes in total. Each of them inherits from a base class. For each part, I will introduce all the variables and functions needed to be cared about.

  • Compliance Predicate Handler (Where to define your gadget)
  • Message (Edge label)
@learncfinaweek
learncfinaweek / gist:4121080
Created November 20, 2012 21:00
Decision Making and Scopes - Scopes

ColdFusion groups variables together in scopes, or a range in which a variable can be accessed. Think of a scope as a bucket of memory that can store variables. Each scope has its own purpose, and each scope has its own lifecycle.

The following table shows major scopes available in a running ColdFusion application:

  • Variables: Default scope available in ColdFusion templates. Variables are available only during the execution of the template.
diff -Naur sammy.orig/lib/plugins/sammy.template.js sammy/lib/plugins/sammy.template.js
--- sammy.orig/lib/plugins/sammy.template.js 2010-11-16 19:23:30.508730579 +0300
+++ sammy/lib/plugins/sammy.template.js 2010-11-16 19:23:51.988731323 +0300
@@ -19,22 +19,23 @@
// Generate a reusable function that will serve as a template
// generator (and which will be cached).
fn = srender_cache[name] = new Function("obj",
- "var p=[],print=function(){p.push.apply(p,arguments);};" +
+ "var ___$$$___=[],print=function(){___$$$___.push.apply(___$$$___,arguments);};" +
@zodoz
zodoz / gist:5152201
Created March 13, 2013 13:46
Useful PEGjs piece that can allow optional parts of a grammer to occur without a required order and be arrayed. Thus you can have only one block of "a"s, "b"s, and "c"s in any order, but as many blocks of "x"s, "y"s, and "z"s again in any order.
{var aDone = bDone = cDone = false;}
start = part part?
part = sets:set*
{
var ret = {};
for(var i=0;i<sets.length;i++) {
// add to set if it already exists
if(ret[sets[i].type] !== undefined) {
{
function styleProps() {
// size : style / config
return ['className', 'size', 'width', 'disabledLabel', 'textAlign', 'marginRight', 'marginLeft', 'marginTop', 'marginBottom', 'contentSpan'];
}
function configProps() {
return ['htmlType', 'dataSource', 'button', 'value', 'defaultValue', 'placeholder', 'type', 'html', 'autoWidth', 'max', 'min', 'addButtonLabel', 'indexFormat', 'mode', 'data-repeater', 'shape', 'previewHidden'];
}
function ruleProps() {
return ['rule', 'showPath'];