Skip to content

Instantly share code, notes, and snippets.

@flrt
flrt / ex-quest_ext.json
Created December 10, 2020 10:26
exemple FHIR question avec extensions sur les types
{
"resourceType": "Questionnaire",
"id": "1100199",
"identifier": [ {
"id": "1100-1234"
} ],
"version": "1",
"name": "quest1",
"title": "Mon Questionnaire",
"status": "draft",
@flrt
flrt / b64pdf.py
Created August 21, 2020 15:53
base64 to pdf
b64="..."
from base64 import b64decode
bytes=b64decode(b64, validate=True)
if bytes[0:4] != b'%PDF':
raise ValueError("PDF KO")
with open("file.pdf","wb") as fout:
fout.write(bytes)
@flrt
flrt / test-open.html
Created January 3, 2018 14:45
Open link in the same window/tab
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<script>
@flrt
flrt / test_inc.ktr
Created May 29, 2017 10:43
Pentaho Test Inc +1 (transformation)
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>test_inc</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<trans_status>0</trans_status>
<directory>&#x2f;</directory>
@flrt
flrt / gitlab-ce_limits
Created February 3, 2017 07:17
Gitlab CE - set projects limits
# gitlab-rails console production
irb(main):016:0> user=User.find_by(username:"bob")
irb(main):017:0> user.projects_limit=100
irb(main):018:0> user.save
@flrt
flrt / es-teams-test-bool-query.sh
Last active August 29, 2015 14:27
ElasticSerach : Query on 2 values (properties) - bool
#!/usr/bin/env bash
echo "\n Delete old index"
curl -XDELETE 'http://localhost:9200/teams'
# Create index with default mappings
#curl -XPUT 'http://localhost:9200/teams'
# Create index with explicit mapping for nested element
curl -XPUT 'http://localhost:9200/teams' -d'{
@flrt
flrt / create-es-units-testplan.sh
Last active August 29, 2015 14:26
ElasticSearch Query+Filter - tests
#!/usr/bin/env bash
echo "\n Delete old index"
curl -X DELETE 'http://localhost:9200/units
curl -XPUT 'http://localhost:9200/units'
echo "\n Add documents"
curl -XPUT 'http://localhost:9200/units/unit/123' -d '{
@flrt
flrt / gist:3621736
Created September 4, 2012 14:37 — forked from oborder/gist:3103533
angularjs directive for bootstrap datepicker : eternicode/bootstrap-datepicker, eyecon.ro
angular.module('bDatepicker', []).
directive('bDatepicker', function(){
return {
require: '?ngModel',
restrict: 'A',
link: function($scope, element, attrs, ngModelCtrl) {
var originalRender, updateModel;
updateModel = function(ev) {
return $scope.$apply(function() {
return ngModelCtrl.$setViewValue(ev.date);