Skip to content

Instantly share code, notes, and snippets.

View Weffe's full-sized avatar

Weffe Weffe

View GitHub Profile
<!-- dashboard.html -->
{% block dojango_content %}
<div id="root"></div>
<script type="text/babel">
const App = () => (
<div>
<h1>Hello World</h1>
<p>This is React! Woo-hoo!</p>
<p>Name -> {% firstof user.first_name user.username %}</p>
@Weffe
Weffe / withValueField.tsx
Last active March 21, 2019 15:38
[TS] withValueField HoC for @progress/kendo-react-dropdowns
import * as React from 'react';
import {
DropDownList,
ComboBox,
ComboBoxProps,
DropDownListProps,
DropDownListBlurEvent,
ComboBoxBlurEvent,
DropDownListFocusEvent,
ComboBoxFocusEvent,
@Weffe
Weffe / nonblocking.py
Created February 13, 2019 20:41
Calculate execution time for non-blocking communication in mpi4py
import numpy
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
# Non Blocking Send & Recv
request = None
status = None
@Weffe
Weffe / Makefile
Last active February 6, 2019 20:28
Makefile for ease of use with mpich docker container
FULL_PATH_CURR_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
start:
# start up docker container and name it mpidev
docker run --name mpidev -it --rm -v $(FULL_PATH_CURR_DIR):/project nlknguyen/alpine-mpich
build:
# compile code
mpicc ./$(src).c -o $(src)
@Weffe
Weffe / deepstream-server.js
Created November 25, 2017 01:26
deepstream server as a Node process
const DeepstreamServer = require('deepstream.io');
const MongoDBStorageConnector = require('deepstream.io-storage-mongodb');
const C = DeepstreamServer.constants;
/*
The server can take
1) a configuration file path
2) null to explicitly use defaults to be overriden by server.set()
3) left empty to load the base configuration from the config file located within the conf directory.
4) pass some options, missing options will be merged with the base configuration
*/