Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
@amitaibu
amitaibu / Elm.md
Last active August 10, 2020 10:20
/**
* Test UGC creation from the My library page.
*/
public function testMyLibraryUgcCreate() {
}
/**
* Test the "My UGC" listing page.
*/
DROP TABLE IF EXISTS employees;
CREATE TABLE employees( id integer, name text,
designation text, manager integer,
hired_on date, salary integer,
commission float, dept integer);
INSERT INTO employees VALUES (1,'JOHNSON','ADMIN',6,'1990-12-17',18000,NULL,4);
INSERT INTO employees VALUES (2,'HARDING','MANAGER',9,'1998-02-02',52000,300,3);
INSERT INTO employees VALUES (3,'TAFT','SALES I',2,'1996-01-02',25000,500,3);
INSERT INTO employees VALUES (4,'HOOVER','SALES I',2,'1990-04-02',27000,NULL,3);
hledger to Excel/ SASS solutions is like:
 -Git to SVN
- Proper IDE/ VIM/ Emacs to Notepad
- Automated script to manual work
With plain text accounting you can start thinking about your financial data in ways you haven't been able so far:
- Version controlled, with all the Git goodies and workflows that come with it.
- Piece of mind, that your data will always remain, history is always there, and it's readable forever.
@amitaibu
amitaibu / gist:4427e2319ebc3d8aa0bcd9264270e6f3
Last active March 19, 2024 15:26 — forked from djazayeri/gist:d3dc89988486fe6f988d
Example of using OpenMRS REST to create a patient and an encounter (in OpenMRS 2.1)
// go to https://demo.openmrs.org, log in as admin/Admin123, open the JavaScript console, and do the following:
var URL_BASE = "https://demo.openmrs.org/openmrs/ws/rest/v1/";
var resources = {};
function andLog(data) { console.log(data); }
function andSaveAs(variable) { return function(data) { resources[variable] = data; console.log(variable + " => " + JSON.stringify(data)); } }
function andSaveFirstResultAs(variable) { return function(data) { data = data.results[0]; resources[variable] = data; console.log(variable + " => " + JSON.stringify(data)); } }
function random() { return Math.floor(Math.random() * 10000); }
function post(resource, data, success) {
$.ajax({ type: "POST", url: URL_BASE + resource, contentType: "application/json", data: JSON.stringify(data), success: success });
$detected_env = 'dev';
switch ($detected_env) {
case 'dev':
$config['config_split.config_split.dev']['status'] = TRUE;
$config['environment_indicator.indicator']['bg_color'] = '#4caf50';
$config['environment_indicator.indicator']['fg_color'] = '#000000';
$config['environment_indicator.indicator']['name'] = 'Dev';
break;
@amitaibu
amitaibu / hledger-flow.yml
Created January 12, 2020 12:54
GitHub Action to validate hledger-flow
# .github/workflows/hledger-flow.yml
name: Validate hledger-flow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
2019/11/19 רופא שיניים
expenses:health $ 100.00
assets:bank
2019/11/20 Dentist
expenses:health $ 100.00
assets:bank
hledger print -f in-out.csv
2019/12/01
hledger: both amount-in and amount-out have a value
amount-in: 0
amount-out: 10
record: the CSV record is: "01/12/19","foo","0","10"