Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<csv-inputs xmlns="http://axelor.com/xml/ns/data-import"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.4.xsd">
<!-- IMPORT DU PACKAGE 'AUTH' -->
<input file="auth_permission.csv" separator=";" type="com.axelor.auth.db.Permission"
search="self.name = :name"/>
@carld
carld / tsort.g
Created June 8, 2020 06:27 — forked from hilverd/tsort.g
Topological sort in Graphviz's gvpr
BEGIN {
int visited[node_t];
int visit(node_t n, edge_t e) {
if (visited[n] == 0) {
visited[n] = 1;
for (e = fstin(n); e; e = nxtin(e)) {
visit(e.tail, NULL);
}
@jjwatt
jjwatt / yplay.scm
Last active April 7, 2025 09:39
The Y Combinator explained in a runnable Scheme file
;;; The Y Combinator explained in scheme.
;;; with credits to:
;;; https://mvanier.livejournal.com/2897.html
;;; Status: WIP
(define fibonacci
(lambda (n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))))
@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver).md
Last active August 3, 2025 18:20
Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

@rain-1
rain-1 / closure-conversion.rkt
Created February 16, 2019 10:06
Closure Conversion
#lang racket
;; this is a stand alone simple version of the closure conversion part of the hoist pass from the tarot compiler
;; see https://rain-1.github.io/scheme for more.
(require data/queue)
;; closure conversion for lambda calculus
;;
;; the input language is:
@reachsumit
reachsumit / Audio Steganography_ultrasound - sender.ny
Last active March 25, 2024 16:06
This code was shared by Audacity user edgar-rft (https://forum.audacityteam.org/memberlist.php?mode=viewprofile&u=5642) to generate silent subliminals and is an implementation of Oliver M. Lowery's 1989 patent (https://patents.google.com/patent/US5159703A/en).
;nyquist plug-in
;version 1
;type process
;name "Subliminal..."
;action "Subliminal..."
;control carrier "Carrier" real "Hz" 17500 14000 20000
(setf carrier (max 14000 (min carrier 20000)))
;; We have two Nyquist frequencies, carrier/2 and *sound-srate*/2.
@ripesunflower
ripesunflower / tap.md
Created September 15, 2017 06:14
The Task-based Asynchronous Pattern
@staydecent
staydecent / decouple-react-api-calls.md
Last active May 14, 2018 18:28
How to keep API calls decoupled from React components

Keeping API calls decoupled from React components keeps your views pure and without side-effects! This makes it easier to test your views without having to worry about API calls. You can test your API separately from your views.

Some Assumptions

Before I dive any deeper, here are some assumptions: You are using React to render your views (HTML). You are using Redux, or something similar to handle state. Myself, I actually use Preact and Atom instead of React and Redux -- They are both much smaller and their source codes are easy to understand, which I favour. The APIs are basically the same. And, I'm also assuming you rely heavily on Redux/Atom and not on React's setState method.

Moving Request Logic Outside Of Your Views

If you're coming from MVC, then you know your views should be simple and without complex logic. Instead, you would use the Controller to load remote data and do any normalization. But where is the Controller when using React and Redux? There isn't really a controller, but that