Skip to content

Instantly share code, notes, and snippets.

View wufe's full-sized avatar

Simone Bembi wufe

View GitHub Profile
@wufe
wufe / ping.js
Created September 12, 2019 19:24
Self-halting node.js server
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('OK');
process.exit(0);
}).listen(3999, '0.0.0.0');
@wufe
wufe / keybase.md
Created August 4, 2019 15:02
keybase.md

Keybase proof

I hereby claim:

  • I am wufe on github.
  • I am simonebmb (https://keybase.io/simonebmb) on keybase.
  • I have a public key whose fingerprint is C0F2 46EA A47C A130 7461 2B6E F89E 9765 49AC B0B0

To claim this, I am signing this object:

@wufe
wufe / gulpfile.js
Created November 2, 2018 09:41
Parcel on visual studio
var gulp = require("gulp"),
shell = require("gulp-shell");
gulp.task("build-parcel:compile", shell.task("parcel build wwwroot/js/site.js", { cwd: __dirname }));
gulp.task("build-parcel:watch", function(){
gulp.watch([
"wwwroot/**/*.js",
"wwwroot/**/*.vue",
], ["build-parcel:compile"]);
});
@wufe
wufe / asd.c
Created September 16, 2018 21:20
asd
#include <stdio.h>
#include <math.h>
int main() {
int array[7] = {1,1,1,2,1,1,1};
int arrayLength = sizeof(array)/sizeof(int);
printf("Array length is %d\n", arrayLength);
double mid = (double)arrayLength / 2;
int pivotIndex = ceil(mid);
Set-NetConnectionProfile -InterfaceAlias "vEthernet (DockerNAT)" -NetworkCategory Private
winrm qc
@wufe
wufe / index.ts
Created August 29, 2018 07:57
TS Recursive partial
type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> };
@wufe
wufe / docker-compose.yml
Created July 27, 2018 12:54
Redis cluster
version: '2'
services:
master:
image: kesshin/redis-node:latest
expose:
- "6379"
ports:
- "7001:6379"
networks:
@wufe
wufe / Saga.MD
Last active November 17, 2016 13:30
redux-saga summary

Redux-Saga - Summary

The middleware

import {default as Saga} from 'redux-saga'; // or import Saga
import {createStore} from 'redux';

const saga = Saga();
@wufe
wufe / Redux.MD
Created November 14, 2016 13:58
Redux summary

This file is intended as a reminder for Redux practices

1- The Store

Store is created using a configureStore snippet, which is

import {createStore, applyMiddleware, compose} from 'redux';
import rootReducer from '../reducers';
import reduxImmutableStateInvariant from 'redux-immutable-state-invariant';
@wufe
wufe / Readme.md
Created November 2, 2016 12:38
Cannot find name 'Promise'. - Typescript solution

First, install @types/core-js

npm install --save @types/core-js

Next, import the definition type into your code

/// <reference path="../node_modules/@types/core-js/index.d.ts" />