Skip to content

Instantly share code, notes, and snippets.

@ignition42
ignition42 / advanced_forum_guest_user_count.patch
Created December 16, 2015 19:05
patch for showing guest user count statistics on the advanced_forum module of Drupal
diff --git a/sites/all/modules/advanced_forum/advanced_forum.module b/sites/all/modules/advanced_forum/advanced_forum.module
--- a/sites/all/modules/advanced_forum/advanced_forum.module
+++ b/sites/all/modules/advanced_forum/advanced_forum.module
@@ -815,11 +815,15 @@ function advanced_forum_session_count($anonymous = TRUE) {
$interval = REQUEST_TIME - variable_get('user_block_seconds_online', 900);
$query = db_select("sessions", "s")
- ->fields("s", array("uid"))
- ->distinct()
- ->condition('s.timestamp', $interval, '>=')
let autobahn = require('autobahn');
const URL = 'wss://api.poloniex.com';
const REALM = 'realm1';
let PAIR = 'BTC_ETH';
let MAX_FOLLOWING_SEQ = 150;
let main = () => {
let connection = new autobahn.Connection({
@ignition42
ignition42 / gen_eth_keys.sh
Last active February 10, 2023 00:22
Generate ethereum key pairs and address
#!/bin/bash
# Source: https://kobl.one/blog/create-full-ethereum-keypair-and-address/
# Install dependencies
sudo apt-get install openssl curl
# Download prebuilt sha3 keccak
if [ $(uname -m) == 'x86_64' ]; then
curl -L -O https://github.com/vkobel/ethereum-generate-wallet/raw/master/lib/x86-64/keccak-256sum
else