Skip to content

Instantly share code, notes, and snippets.

View alapini's full-sized avatar
🎯

Luc Alapini alapini

🎯
View GitHub Profile
@alapini
alapini / class.nim
Created March 10, 2024 15:44 — forked from bucho666/class.nim
nim class macro
import macros
proc typeName(head: NimNode): NimNode =
if head.len == 0: head else: head[1]
proc baseName(head: NimNode): NimNode =
if head.len == 0: newIdentNode("RootObj") else: head[2]
proc isObjectDef(head: NimNode): bool =
head.len == 0 or head[2].kind == nnkIdent
@alapini
alapini / LICENSE
Created October 30, 2023 19:44 — forked from bollwyvl/LICENSE
Towards a JSON Schema for the Language Server Protocol
Copyright 2019 dead pixels collective
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@alapini
alapini / Json.xtext
Created December 27, 2022 10:30 — forked from nightscape/Json.xtext
Xtext grammar for JSON documents
grammar org.json.Json with org.eclipse.xtext.common.Terminals
generate json "http://www.json.org/"
Object:
'{' ((members+=Member) (',' members+=Member)*)? '}';
Member:
key=STRING ':' value=Value;
@alapini
alapini / parsers.nim
Created August 12, 2022 14:39 — forked from kmizu/parsers.nim
parser combinator library in Nim
import strutils
import lists
import re
type
Parser[T] = proc(input: string): Maybe[(T, string)]
Maybe*[T] = object
value: T
hasValue: bool
@alapini
alapini / columns-template.js
Created March 9, 2022 03:27 — forked from markotom/columns-template.js
Create column form layout using react-jsonschema-form and marble-seed
import React, { Component } from 'react'
import api from '~base/api'
import classNames from 'classnames'
import {
BaseForm,
TextWidget,
EmailWidget,
NumberWidget
} from '~base/components/base-form'
@alapini
alapini / WSSecurityVerifier.java
Created November 16, 2021 13:34 — forked from luiswolff/WSSecurityVerifier.java
This gist shows how to verify a signed Soap-Message using Apache WSS4J
package de.wolff.wsst;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Properties;
import java.util.regex.Pattern;
@alapini
alapini / example-grid-craft.js
Created November 7, 2021 13:40 — forked from prevwong/example-grid-craft.js
A simple Grid layout system with Craft.js
// Get total `width` of all children
const getAccumulatedChildrenWidth = (helper, parentId) => {
return helper(self.id).decendants().map(id => helper(id).get())
.reduce((a, b) => a.data.props.width + b.data.props.width, 0);
}
const Grid = () => {
return (
<div>
{children}
@alapini
alapini / all_email_provider_domains.txt
Created September 13, 2021 08:07 — forked from ammarshah/all_email_provider_domains.txt
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
@alapini
alapini / frac-diff_sk
Created April 20, 2020 15:53 — forked from skuttruf/frac-diff_sk
Python code for fractional differencing of pandas time series
"""
Python code for fractional differencing of pandas time series
illustrating the concepts of the article "Preserving Memory in Stationary Time Series"
by Simon Kuttruf
While this code is dedicated to the public domain for use without permission, the author disclaims any liability in connection with the use of this code.
"""
import numpy as np
import pandas as pd
@alapini
alapini / mkl.dockerfile
Created February 19, 2020 13:07 — forked from mgoldey/mkl.dockerfile
install basic mkl libraries in debian docker image
# install mkl
RUN apt update && apt install -y --force-yes apt-transport-https && \
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install cpio intel-mkl-64bit-2018.3-051 && \
(find /opt/intel -name "ia32*" -exec rm -rf {} \; || echo "removing ia32 binaries") ; \
(find /opt/intel -name "examples" -type d -exec rm -rf {} \; || echo "removing examples") ; \
(find /opt/intel -name "benchmarks" -exec rm -rf {} \; || echo "removing benchmarks") ; \
(find /opt/intel -name "documentation*" -exec rm -rf {} \; || echo "removing documentation") ; \