Skip to content

Instantly share code, notes, and snippets.

View loxy's full-sized avatar

Kersten Lorenz loxy

  • Interlusion
  • Dortmund, Germany
View GitHub Profile
@jeroenheijmans
jeroenheijmans / ngb-momentjs-adapter.ts
Last active March 3, 2022 13:34
NgbDateAdapter for Moment.js values
import { NgbDateAdapter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
import { Injectable } from '@angular/core';
import * as moment from 'moment';
// Might need to polyfill depending on needed browser support...
const isInt = Number.isInteger;
@Injectable()
export class NgbMomentjsAdapter extends NgbDateAdapter<moment.Moment> {
@kaplan81
kaplan81 / _testing.md
Last active August 8, 2022 19:27
Angular unit test helpers and samples

Testing

Helpers and examples for unit testing on Angular applications and libraries.

@homuler
homuler / prime_sieves.sql
Last active December 29, 2022 12:57
Sieving Prime Numbers in SQL (PostgreSQL 9.6)
-- Enumerate prime numbers below N using only SQL
-- DDL
create table primes(
value integer primary key,
sieved boolean not null default false
);
create index prime_sieve_idx on
primes(value, sieved);
@shawnbot
shawnbot / index.md
Last active August 23, 2023 10:18
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

@olragon
olragon / postgraphile+4.13.0.patch
Last active October 28, 2024 20:43
Postgraphile plugin for Elysia
diff --git a/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js b/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js
index 73bc159..1b1d23d 100644
--- a/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js
+++ b/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js
@@ -717,7 +717,14 @@ function createPostGraphileHttpRequestHandler(options) {
operationName,
}, (graphqlContext) => {
pgRole = graphqlContext.pgRole;
- const graphqlResult = graphql_1.execute(gqlSchema, queryDocumentAst, null, graphqlContext, variables, operationName);
+ const graphqlResult = graphql_1.execute({
@btroncone
btroncone / rxjs_operators_by_example.md
Last active March 30, 2025 21:26
RxJS 5 Operators By Example
@NYKevin
NYKevin / accounting.sql
Last active May 27, 2025 22:23
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@bmaupin
bmaupin / open-source-sso.md
Last active June 13, 2025 14:34
Comparison of some open-source SSO implementations

⚠️ This is not maintained. Feel free to check comments and/or forks for more current options.

Background

This was created years ago; at the time I'd been a Shibboleth admin for nearly a decade but we needed something that could handle OIDC/OAuth and that explicitly supported OpenJDK. After a lot of investigation, I really liked Keycloak/Red Hat Single Sign-On. More details here: Gluu vs keycloack vs wso2 identity management

Comparison

(Items in bold indicate possible concerns)

@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();