Skip to content

Instantly share code, notes, and snippets.

View harm-smits's full-sized avatar
🖥️
while (!(succeed = try()));

Harm Smits harm-smits

🖥️
while (!(succeed = try()));
  • Optiver
  • Amsterdam
  • 04:29 (UTC +02:00)
  • LinkedIn in/harmsmits
View GitHub Profile
@harm-smits
harm-smits / url.js
Last active October 12, 2020 12:24
Simple url function to add / remove components of a url dynamically
const URL_REGEX = /^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i
/**
* Map search parameters to an according associative array
* @param search
* @returns {{}}
*/
function mapSearchParams(search) {
let map = {}
if (typeof search === 'string') {
@rampion
rampion / try-catch-ex.c
Created April 8, 2009 02:35
TRY/CATCH/FINALLY macros for C
// gcc -o try-catch-ex try-catch.c try-catch-ex.c
#include <stdio.h>
#include "try-catch.h"
// Example of use for try-catch.h
int main(int argc, char *argv[])
{
int i = 101;
printf("before try block...\n");