Skip to content

Instantly share code, notes, and snippets.

View jooray's full-sized avatar

Juraj Bednar jooray

View GitHub Profile
@mmmaly
mmmaly / transcribe.sh
Created November 13, 2018 18:31
Call Google speech recognize
#!/bin/bash
fileogg=$1
name=${fileogg%.ogg}
file=$name.flac
ffmpeg -i $fileogg -ar 16000 $file 2>/dev/null
gsutil cp $file gs://transcribe
gcloud ml speech recognize-long-running gs://transcribe/$file --sample-rate 16000 --encoding flac --language-code='sk-SK' --async > $$.id
id=`jq -r .name < $$.id `
gcloud ml speech operations wait $id > $name.json
@miguelmota
miguelmota / bch_transaction.js
Last active August 15, 2018 12:23
JavaScript/Node.js Bitcoin Cash (BCH) get unspent utxos and sign transaction [testnet] example
const explorers = require('bitcore-explorers')
const insight = new explorers.Insight('https://test-bch-insight.bitpay.com')
const bch = require('bitcoincashjs')
const buf = new Buffer('__your_64_bit_private_key__', 'hex')
const privateKey = new bch.PrivateKey(buf, 'testnet')
const address = privateKey.toAddress('testnet')
insight.getUnspentUtxos(address.toString(), function (error, utxos) {
if error {
@tyzbit
tyzbit / Useful lncli aliases.md
Last active July 24, 2021 23:57
Useful commands/aliases for interacting with LND using lncli (https://github.com/lightningnetwork/lnd)

I am not responsible, directly or indirectly for the loss of funds using these commands. Use at your own risk.

Informational Commands

lrecv

Channels with received satoshis

alias lrecv="lncli listchannels | jq '[ .channels | .[] | select(.total_satoshis_received|tonumber>0) ]'"

loffchain

Channels with offchain transactions

@xavierlepretre
xavierlepretre / promisifyWeb3.js
Created January 8, 2017 17:36
Convert `web3` asynchronous calls into Promises.
module.exports = {
promisify: function (web3) {
// Pipes values from a Web3 callback.
var callbackToResolve = function (resolve, reject) {
return function (error, value) {
if (error) {
reject(error);
} else {
resolve(value);
}
@Zodiac1978
Zodiac1978 / .htaccess
Last active May 3, 2024 12:11
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
@kopischke
kopischke / markdown2evernote.rb
Created June 5, 2011 16:57
OS X service scripts
#!/usr/bin/env ruby -wKU
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/)
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/)
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line)
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript)
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script)
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing;
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1
# – handle both smart typography processing scripts (ie. SmartyPants.pl)