Skip to content

Instantly share code, notes, and snippets.

View alapini's full-sized avatar
🎯

Luc Alapini alapini

🎯
View GitHub Profile
@prevwong
prevwong / example-grid-craft.js
Created January 4, 2020 18:54
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}
@bollwyvl
bollwyvl / LICENSE
Last active April 1, 2024 09:25
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.
@bucho666
bucho666 / class.nim
Last active March 10, 2024 15:44
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
@luiswolff
luiswolff / WSSecurityVerifier.java
Created June 5, 2019 19:54
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;
@skuttruf
skuttruf / frac-diff_sk
Last active July 18, 2024 23:03
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
@lfnoise
lfnoise / virtual_arrays.nim
Last active January 17, 2022 05:42
[fixed version] my second day of trying out Nim.
import system
import math
type
VArray[T] = ref object of RootObj
len : int
VSeries[T] = ref object of VArray[T]
start, step: T
@phausamann
phausamann / pycharm_conda.bat
Created November 16, 2018 08:29
Launch PyCharm from within conda environment
:: Launch PyCharm from within conda environment
:: This will ensure that all necessary environment variables are set.
:: Modify the paths and environment name for your installation, if necessary.
:: This configuration is for PyCharm x64 installed with JetBrains Toolbox and
:: will launch the latest installed version.
@set condaroot="%userprofile%\Anaconda3"
@set pycharmroot="%localappdata%\JetBrains\Toolbox\apps\PyCharm-P\ch-0"
@set env=base
@mgoldey
mgoldey / mkl.dockerfile
Created August 6, 2018 19:52
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") ; \
@markotom
markotom / columns-template.js
Last active October 16, 2023 04:25
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'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.