https://redcanary.com/blog/clipping-silver-sparrows-wings/
Past this in a Terminal window:
curl -s https://gist.githubusercontent.com/davidrapin/f74010691e9a08ab9ca225949e622bba/raw/03d1927c01178bd44416da70f464a2d8a34d8b52/ssp-clean.sh | bash -s --
# source: https://docs.oracle.com/en/database/oracle/property-graph/24.2/spgdg/getting-started-pgql.html | |
# source: https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/CREATE-TABLE.html | |
# list databases | |
# SELECT ora_database_name from dual; | |
# show table cols | |
# DESC all_tables; | |
# create a graph |
#!/bin/bash | |
set -e | |
# resources: | |
# https://github.com/openssl/openssl/blob/master/README-FIPS.md#installing-the-fips-provider-and-using-it-with-the-latest-release | |
# https://nodejs.org/docs/latest/api/all.html#all_crypto_fips-mode | |
# https://nodejs.org/api/cli.html#--enable-fips | |
# parse command line options | |
if [ -z "$1" ]; then |
// edgeCount: the number of edges with a unique edge-type to generate | |
// sourceNodeId: ID of the node to be used as source for all generated edges | |
// targetNodeId: ID of the node to be used as target for all generated edges | |
// prefix: the edge-type prefix to use for generated edge-types | |
WITH 100 as edgeCount, 1 as sourceNodeId, 2 as targetNodeId, "edge_type_prefix_" as prefix | |
MATCH (a), (b) WHERE id(a) = sourceNodeId and id(b) = targetNodeId | |
WITH range(1, edgeCount) as xx, a, b | |
UNWIND xx AS x | |
CALL apoc.create.relationship(a, prefix + toString(x), {property: x}, b) YIELD rel |
// amount: number of random dates to create | |
// startYear: year range start | |
// startYear: year range end | |
WITH 1000 as amount, 2017 as startYear, 2021 as endYear | |
WITH range(1, amount) as xx, startYear, (endYear - startYear) as yearRange | |
UNWIND xx as x | |
WITH date({ | |
year:toInteger(1+startYear+floor(rand()*yearRange)), | |
month:toInteger(1+floor(rand()*12)), |
https://redcanary.com/blog/clipping-silver-sparrows-wings/
Past this in a Terminal window:
curl -s https://gist.githubusercontent.com/davidrapin/f74010691e9a08ab9ca225949e622bba/raw/03d1927c01178bd44416da70f464a2d8a34d8b52/ssp-clean.sh | bash -s --
# go to correct home folder (itgerwise tomcat will fail) | |
cd /Applications/UniFi.app/Contents/Resources/ | |
# start unify app with correct java-home (java8 needed) | |
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/ java -jar /Applications/UniFi.app/Contents/Resources/lib/ace.jar ui & | |
# open your browseron the local server | |
open https://localhost:8443 |
// from https://www.npmjs.com/package/sha1 | |
var sha1 = require("sha1") | |
// compute (sha1) hash modulo | |
function hash_modulo(str, modulo) { | |
// ignore case of input | |
str = str.toUpperCase(); | |
// compute sha1 of input | |
let h = sha1(str); | |
// use only the 8 last bytes (4 last hex chars) of the sha1 |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
border: 1px solid red; | |
} | |
</style> |
You should be able to use the TypeChecker API from the compiler to get to the type information you need. there is no serialization logic readily available, but should be possible to add one.
Here is the TypeChecker API: https://github.com/Microsoft/TypeScript/blob/085f0df4556801c14a4333d6c1d0bab1375586e4/lib/typescript.d.ts#L1027-L1057
Documentation on using the compiler API: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API
Here is the part of the emitter that emitts this infromation today using the Checker: https://github.com/Microsoft/TypeScript/blob/085f0df4556801c14a4333d6c1d0bab1375586e4/src/compiler/emitter.ts#L5065-L5104
// this is a work-in-progress (currently broken), don't use it as-is. | |
function patchRequire(verbose) { | |
var Module = require('module'); | |
var originalRequire = Module.prototype.require; | |
var SENSITIVE_MODULES = ['fs', 'child_process', 'cluster', 'vm']; | |
var stack = []; | |
/** | |
* @param {string} moduleId Package id |