Skip to content

Instantly share code, notes, and snippets.

View oliversalzburg's full-sized avatar
💭
>:(

Oliver Salzburg oliversalzburg

💭
>:(
View GitHub Profile
@nickcampbell18
nickcampbell18 / my-test.spec.js
Created October 9, 2023 14:45
Replacing the Undici global dispatch logic with a symbol-less Jest-compatible implementation
test("mocking a request", async () => {
const mockAgent = new MockAgent()
;(global as any).setMockedFetchGlobalDispatcher(mockAgent)
await fetch(...)
})
//
// E2E Test Setup
// e2e_helpers.js
//
import { getMainDefinition } from '@apollo/client/utilities'
import { AuthPayload } from '../../lib/typings/goodchat'
import { WebSocketLink } from '@apollo/client/link/ws'
import { promisify } from 'util'
import fetch from 'cross-fetch'
@rjhansen
rjhansen / keyservers.md
Last active April 14, 2024 12:28
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@mdlavin
mdlavin / lambda-function-xray-enablement.tf
Last active March 18, 2024 14:38
Terraform configuration to enable X-Ray for a Lambda function
resource "aws_lambda_function" "service" {
# Your usual aws_lambda_function configuration settings here
tracing_config {
mode = "Active"
}
}
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@Mariovc
Mariovc / ImagePicker.java
Last active February 7, 2024 23:33
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
@hmbilal
hmbilal / debug-ui-router.js
Last active December 13, 2023 14:42
Debugging Angular ui-router routes in browser console.
// Paste this code in browser console to debug ui-router problems when navigating through states.
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope');
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeStart from '+fromState.name+'- fired when the transition begins. fromState,fromParams : \n',fromState, fromParams);
console.log('$stateChangeStart to '+toState.name+'- fired when the transition begins. toState,toParams : \n',toState, toParams);
});
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 25, 2024 12:16
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@kendfrey
kendfrey / darkchat.css
Last active January 2, 2016 21:39
Dark Chat
body {
background-color : #000 !important;
background-image : url("http://raw.github.com/oliversalzburg/se-chat-dark-theme/master/img/skewed_print.png") !important;
color : #ddd !important;
}
.messages {
background-color : #222 !important;
border : none !important;
color : #ddd !important;
@gak
gak / fish-prompt.sh
Last active February 4, 2022 18:34
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
function _common_section
printf $c1
printf $argv[1]
printf $c0
printf ":"
printf $c2
printf $argv[2]
printf $argv[3]
printf $c0
printf ", "