Skip to content

Instantly share code, notes, and snippets.

from requests import Session # pip install requests
from signalr import Connection # pip install signalr-client
def handle_received(**kwargs):
print('received', kwargs)
def print_error(error):
print('error: ', error)
@subfuzion
subfuzion / curl.md
Last active May 5, 2024 10:49
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@oscarmorrison
oscarmorrison / IFTTTDate.md
Last active December 3, 2023 21:44
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

@Kronopath
Kronopath / converter.py
Last active March 5, 2024 06:19
WeChat audio converter script. See http://kronopath.net/blog/extracting-audio-messages-from-wechat/ for more details.
# WeChat aud file converter to wav files
# Dependencies:
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec)
# ffmpeg
#
# By Gabriel B. Nunes (gabriel@kronopath.net)
# Adapted from another script by Nicodemo Gawronski (nico@deftlinux.net)
#
import os, argparse, subprocess
import datetime
import hashlib
import hmac
import random
import string
import time
import unirest as unirest
key = "da01c7e1f0dc4f166c6aa3d56add3293"
secret = "XXXXXXXXXXXXXXXXXXXXXXXXXX"
# MAC ADDRESS SPOOFER
MAC=""
for i in {0..5}; do
VAL=$RANDOM
PART=$(printf "%2X" $VAL)
MAC+=$(printf "%.2s" $PART)
if [ $i -lt 5 ]
@BurnBabyBurn71
BurnBabyBurn71 / User-Pass-gen
Created September 8, 2014 12:24
Reddit random username and password generator - beanon!
import string, random
#User
print('USERNAME - ' + 'beanon' + '-' + ''.join(random.choice(string.digits) for i in range(4)) + ''.join(random.choice(string.ascii_lowercase) for i in range(4)) + ''.join(random.choice(string.ascii_uppercase) for i in range(4)))
#Pass
print('PASSWORD - ' + ''.join(random.choice(string.digits) for i in range(5)) + ''.join(random.choice(string.ascii_lowercase) for i in range(5)) + ''.join(random.choice(string.ascii_uppercase) for i in range(5)))
@yuryoparin
yuryoparin / google_oauth2.sh
Created May 4, 2014 11:19
Google OAuth 2.0 in Bash
#! /bin/bash
# The approx. time to run this script is 145 ms.
# First we extract the private PEM key from the .p12 file:
# openssl pkcs12 -nocerts -passin 'notasecret' -in file.p12 -out ~/google/google.privatekey.pem
KEY='~/google/google.privatekey.pem'
# The fields are ordered by their hash values.
# In Google Client for Java HashMap is used to stack all JSON fields, so String.hashCode() is used for ordering.
@hitbtc-com
hitbtc-com / hitbtc_example.php
Last active September 2, 2023 18:34
hitbtc php example
<?php
namespace Hitbtc;
/**
* show off @method
*
* @method string balance() balance( array $params )
* @method string ordersActive() ordersActive( array $params )
* @method string new_order() new_order( array $params )
* @method string cancel_order() cancel_order( array $params )
* @method string trades() trades( array $params )