Skip to content

Instantly share code, notes, and snippets.

View jaggedsoft's full-sized avatar
Productive

jagged jaggedsoft

Productive
View GitHub Profile
@rochal
rochal / plasma.js
Created May 30, 2012 23:07
plasma.js - Creating Plasma Fractal in JavaScript
/***************************************************************************
* Do What THe Fuck You Want To Public Licence 2 *
* *
* JavaScript implementation by Piotr Rochala (http://rocha.la/) *
* Based on C# work of Serge Meunier (http://www.smokycogs.com/) *
* *
* Check this code in action on http://rocha.la/javascript-plasma-fractal *
* *
**************************************************************************/
@raypulver
raypulver / order.js
Created November 20, 2017 19:32
creating an order with IDEX API
const { soliditySha3 } = require('web3-utils');
const {
hashPersonalMessage,
bufferToHex,
toBuffer,
ecsign
} = require('ethereumjs-util')
const { mapValues } = require('lodash');
const contractAddress = '0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208';
@gcmurphy
gcmurphy / cve_2016_0728.c
Last active September 18, 2018 06:57 — forked from PerceptionPointTeam/cve_2016_0728.c
cve_2016_0728 exploit
/* $ gcc cve_2016_0728.c -o cve_2016_0728 -lkeyutils -Wall */
/* $ ./cve_2016_072 PP_KEY */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <keyutils.h>
#include <unistd.h>
#include <time.h>
@btnwtn
btnwtn / 50.js
Last active September 18, 2019 16:09
Automat dat +50 clapping on Medium.com
(() => {
const up$ = new MouseEvent("mouseup", { bubbles: true });
const down$ = new MouseEvent("mousedown", { bubbles: true });
const node = document.querySelector(
`.js-postActionsFooter button[data-action="multivote"]`
);
let attempts = 0;

API概述

交易市场概况和基础信息

撮合引擎

成交价

CoinAll撮合系统撮合订单的优先级按照价格优于时间的优先级来撮合,优先撮合价格更有优势的订单。当价格一致时按照下单时间顺序撮合,先下单的先撮合。 比如深度列表中目前有3笔挂单等待成交,分别为1: 9900USDT买1BTC,2: 10100USDT买2BTC,3: 9900USDT买1.5BTC。他们是按时间顺序1-2-3进入撮合系统的,根据价格优先,系统优先撮合订单2,根据时间优先,1跟3优先撮合1。所以系统撮合顺序是2-1-3。

@mxriverlynn
mxriverlynn / 1.js
Last active April 15, 2020 14:27
Standard deviation, in JavaScript
var sum = values.reduce(function(sum, value){
return sum + value;
}, 0);
var avg = sum / data.length;
@matthewp
matthewp / decorate-element.js
Last active April 23, 2020 07:57
decorate-element
function decorate(tag, template) {
customElements.define(tag, class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
let root = this.shadowRoot;
if(!root.firstChild) {
@dg
dg / websocket.html
Created August 11, 2013 15:54
WebSocket communication between PHP and single client
<!doctype html>
<script>
if ("WebSocket" in window) {
var ws = new WebSocket("ws://127.0.0.1:31339");
ws.onopen = function() {
console.log('connected');
};
ws.onerror = function(e) {
@benjchristensen
benjchristensen / index.html
Created August 9, 2011 05:38
Simple Sparkline using SVG Path and d3.js
<html>
<head>
<title>Simple Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@talegift
talegift / calculateUniswapTWAP.js
Created November 17, 2020 16:59 — forked from l3wi/calculateUniswapTWAP.js
Off-chain Uniswap V2 TWAP calculator in Javascript
import { ethers } from 'ethers'
// To use this you need to read the Uniswap v2 contract for a pair/
// PRICE pulled from priceXCumulativeLast
// TIMESTAMPS pulled from _blockTimestampLast in getReserves()
// Mock Data
// In a real scenario you would fetch and store price & timestamp at an interval
// to mirror the contract calculating the TWAP on chain
const price0 = '529527205677379158060966860839'