Skip to content

Instantly share code, notes, and snippets.

Felix Becker felixfbecker

Block or report user

Report or block felixfbecker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View not-needed-packages.ps1
#Requires -Module PSGitHub
#Requires -Module PowerGit
[CmdletBinding()]
param()
$items = Get-Content not-needed-packages.txt | Select-String -Pattern 'Typings already defined for ([^ ]+)' -Context 0,5
$i = 0
$items | ForEach-Object {
View build.ps1
#!/usr/bin/env pwsh
$ErrorActionPreference = 'Stop'
$repositoryRoot = $PWD
# Builds the PCRE extension to sqlite3.
function Build-Libsqlite3Pcre {
[OutputType([string])]
param()
View comlink.ts
@felixfbecker
felixfbecker / worker_threads_test.ts
Created Oct 12, 2018
Goroutines in Node with Worker Threads
View worker_threads_test.ts
import { Worker } from 'worker_threads'
export function work<P extends any[], R>(script: (...args: P) => R | PromiseLike<R>, ...args: P): Promise<R> {
return new Promise((resolve, reject) => {
const workerSource = `
const { workerData, parentPort } = require('worker_threads');
Promise.resolve((${script})(...workerData))
.then(result => {
parentPort.postMessage({ type: 'success', result })
}, error => {
@felixfbecker
felixfbecker / protomap.ts
Last active Apr 19, 2018
Immutable __proto__ backed Map
View protomap.ts
// tslint:disable:forin
export class ProtoMap<V> {
private _values: any;
public [Symbol.toStringTag]: 'ProtoMap' = 'ProtoMap'
constructor(init?: Iterable<[string, V]> | { [key: string]: V }) {
this._values = { __proto__: null }
if (init) {
View observable-array.ts
import { Subject } from 'rxjs/Subject'
export interface Splice<T> {
/**
* The zero-based location in the array from which to start removing elements.
*/
start: number
/**
* The number of elements to remove.
*/
@felixfbecker
felixfbecker / profile.ps1
Created Sep 16, 2016
My customized PowerShell prompt
View profile.ps1
# Fix UTF8 Output
# [Console]::OutputEncoding = [Text.Encoding]::UTF8
$OutputEncoding = [Text.Encoding]::UTF8
$env:COMPOSER_DISABLE_XDEBUG_WARN = 1
$env:NPM_CONFIG_UNICOE = 'true'
# A helper function to switch between multiple versions of PHP, NodeJS, ...
function Use-Version($program, $version, $arch) {
View bundle.js.map
{
"version": 3,
"sources": [
"node_modules/browser-pack/_prelude.js",
"node_modules/angular-animate/angular-animate.js",
"node_modules/angular-animate/index.js",
...
"node_modules/angular/angular.js",
"node_modules/angular/index.js",
"node_modules/javascript-natural-sort/naturalSort.js",
View threads_debug.txt
Debugger listening on port 14905
waiting for debug protocol on port 4711
>> accepted connection from client
-> initializeRequest
{ type: 'request',
seq: 1,
command: 'initialize',
arguments: { adapterID: 'php', linesStartAt1: true, pathFormat: 'path' } }
@felixfbecker
felixfbecker / tasks.json
Last active Jun 6, 2018
VS Code tasks.json for Latex to PDF compilation w/ problem matcher
View tasks.json
/*
An example tasks.json for VS Code that defines a task for compiling Latex to PDF including a problem matcher.
This is for Windows but it should be easy to adopt it for Linux/Mac, basically replace powershell with sh and -Command with -c
*/
{
"version": "0.1.0",
"isShellCommand": true,
"suppressTaskName": true,
"windows": {
"command": "powershell",
You can’t perform that action at this time.