Skip to content

Instantly share code, notes, and snippets.

Avatar

Pham Cong Dinh pcdinh

View GitHub Profile
View 2of3.md

2-of-3 Escrow Example with Electrum

This is gmaxwell's 2-of-2 escrow example, adapted to Electrum and to a lesser extent, GFM.

The Scenario

Archey wants to pay Bertha 0.001 BTC for a Twitter Platinum invite, but prevent Bertha from cheating him. Archey selects Iceland to act as

View Microsoft Azure VM CPU performance on Ubuntu 13
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.1053
hashrate: 0.0526
hashrate: 0.0526
hashrate: 0.0526
View aes.py
from binascii import hexlify, unhexlify
from hashlib import md5
from Crypto.Cipher import AES
try:
from M2Crypto import EVP
except ImportError:
EVP = None
def m2_encrypt(plaintext, key, iv, key_as_bytes=False, padding=True):
View gist:af5bf840eb912cddff43
# This file is autogenerated by the get_windows_info.py script
# Do not edit.
win_tz = {'AUS Central Standard Time': 'Australia/Darwin',
'AUS Eastern Standard Time': 'Australia/Sydney',
'Afghanistan Standard Time': 'Asia/Kabul',
'Alaskan Standard Time': 'America/Anchorage',
'Arab Standard Time': 'Asia/Riyadh',
'Arabian Standard Time': 'Asia/Dubai',
'Arabic Standard Time': 'Asia/Baghdad',
'Argentina Standard Time': 'America/Buenos_Aires',
View modx-snippets.php
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
View circus.ini
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
include = *.more.config.ini
debug = true
logoutput=/data1/circus/daemon.log
loglevel=DEBUG
[watcher:api_dev2]
@pcdinh
pcdinh / fs.txt
Last active Aug 29, 2015
FileString file sharing
View fs.txt
POST /2.0/file
{
"file": {
"id": "<string>",
"location": {
"proto": "file",
"name": "<string>",
"path": "<string>",
"is_dir": false
View relations.sql
WITH owner_to_direct_indirect_recipient AS (
SELECT f.FileID,
NULL AS SharedDate,
NULL AS SharingDataKey,
NULL AS Perms,
NULL AS ExpiredDate,
NULL AS IsPrinted,
NULL AS HasWatermark,
NULL AS SharingModifiedDate,
CONVERT(NVARCHAR(36), TODATETIMEOFFSET(fs.SharedDate, '+00:00'), 126) AS SharedDate2,
View infinitescroll.js
app.directive('infiniteScroll', [
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) {
return {
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
elem.css('overflow-y', 'scroll');
elem.css('overflow-x', 'hidden');
elem.css('height', 'inherit');
scrollDistance = 0;
@pcdinh
pcdinh / xmr-bitcoin
Last active Aug 29, 2015
Monero-Bitcoin
View xmr-bitcoin
(1) It uses a different elliptic curve than Bitcoin for signing (EdDSA, which uses Schnorr signatures on a Twisted Edwards curve).
(2) It uses a different hashing algorithm than Bitcoin for PoW, which is AES heavy and currently performs similarly on GPUs
and CPUs. One of the main downsides to this is that sidechains are currently impossible (validation takes too long), however
as sidechains don't actually exist right now we've been ignoring this. If we want to add sidechain support in the future,
the hashing algorithm can be change to something simple. In the meantime, the algorithm is relatively "egalitarian" in that
no specialized hardware is required.
(3) One time use addresses ("stealth addressing") is mandatory for all transactions. This makes light clients very difficult
to secure or create in general, but it dramatically enhances privacy because it's impossible to ever reuse an address.
(4) All transactions are denominated in base 10, and fractionated by mantissa.
(5) Ring signatures obfuscate spe
You can’t perform that action at this time.