This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/useWasm.js | |
export const useWasm = (fileName, imports) => { | |
const [state, setState] = useState(null); | |
useEffect(() => { | |
const fetchWasm = async () => { | |
const wasm = await fetch(fileName); | |
const instance = await AsBind.instantiate(wasm, imports); | |
setState(instance); | |
}; | |
fetchWasm(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
window.WebSocket = window.WebSocket || window.MozWebSocket; | |
var websocket = new WebSocket('ws://127.0.0.1:9000', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CommentPath do | |
@moduledoc""" | |
Comment [closure table](http://www.slideshare.net/billkarwin/models-for-hierarchical-data). | |
""" | |
@primary_key false | |
schema "comment_paths" do | |
field :ancestor_id, Ecto.UUID | |
field :descendant_id, Ecto.UUID | |
field :depth, :integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------------------------------- | |
-- This function is used to update paths when inserted a new node | |
---------------------------------------------------------------------------------------- | |
DROP FUNCTION IF EXISTS after_insert_node(); | |
-- Step 1: Create a function used to update paths | |
CREATE OR REPLACE FUNCTION after_insert_node() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ tmp git clone https://github.com/jekens/ranch_test.git | |
Cloning into 'ranch_test'... | |
remote: Counting objects: 21, done. | |
remote: Compressing objects: 100% (16/16), done. | |
remote: Total 21 (delta 2), reused 21 (delta 2), pack-reused 0 | |
Unpacking objects: 100% (21/21), done. | |
Checking connectivity... done. | |
➜ tmp cd ranch_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu:~/systemtap/systemtap-3.0/testsuite/systemtap.examples/network$ sudo stap -vv /home/ycc/systemtap/systemtap-3.0/testsuite/systemtap.examples/network/nettop.stp | |
Systemtap translator/driver (version 3.0/0.166, non-git sources) | |
Copyright (C) 2005-2015 Red Hat, Inc. and others | |
This is free software; see the source for copying conditions. | |
enabled features: NLS TR1_UNORDERED_MAP | |
Created temporary directory "/tmp/stapZuz725" | |
Session arch: x86_64 release: 4.2.0-36-generic | |
Kernel symbol table /lib/modules/4.2.0-36-generic/build/System.map unavailable, (No such file or directory) | |
Searched for library macro files: "/usr/local/share/systemtap/tapset/linux/*.stpm", found: 5, processed: 5 | |
Searched for library macro files: "/usr/local/share/systemtap/tapset/*.stpm", found: 8, processed: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> build with kerl configurre option is: | |
> KERL_CONFIGURE_OPTIONS="--disable-native-libs --enable-vm-probes --with-dynamic-trace=systemtap --with-ssl=/usr/local --enable-hipe --enable-kernel-poll --without-odbc --enable-threads --enable-sctp --enable-smp-support --enable-sharez-zlib --enable-dynamic-ssl-lib" | |
> When i list the probes about erlang, the result is ok | |
``` | |
ubuntu@ubuntu:~/systemtap$ stap -L 'process("/home/ubuntu/.kerl/builds/18.3_dtrace/release_18.3/erts-7.3/bin/beam.smp").mark("*")' |grep message | |
process("/home/ubuntu/.kerl/builds/18.3_dtrace/release_18.3/erts-7.3/bin/beam.smp").mark("message__queued") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long | |
process("/home/ubuntu/.kerl/builds/18.3_dtrace/release_18.3/erts-7.3/bin/beam.smp").mark("message__receive") $arg1:long $arg2:long $arg3:long $arg4:long $arg5:long $arg6:long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Author: Alex Radetsky <[email protected]> | |
%% Module: Simple SMPP Server on Erlang, gen_fsm, ranch, smpp34pdu. | |
%% It always authorize bind_transceiver and receives submit_sm | |
-module(smpp_protocol). | |
-behaviour(gen_fsm). | |
-behaviour(ranch_protocol). | |
-include_lib("smpp34pdu/include/smpp34pdu.hrl"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
from riak import RiakClient, RiakObject | |
from riak.datatypes import Set | |
import datetime | |
# Riak connection and set | |
client = RiakClient(pb_port=8087) | |
SETS_BUCKET = client.bucket_type('sets').bucket('key_sets') | |
# Get columns for table |
NewerOlder