Skip to content

Instantly share code, notes, and snippets.

View pseudozach's full-sized avatar

pseudozach

View GitHub Profile

Keybase proof

I hereby claim:

  • I am pseudozach on github.
  • I am zozsoy (https://keybase.io/zozsoy) on keybase.
  • I have a public key whose fingerprint is EFB6 E8DB 289B 4AC6 13B3 7DEA 1848 800E FAA9 78F9

To claim this, I am signing this object:

@pseudozach
pseudozach / tck_validation.js
Created July 23, 2015 18:23
kimlik numarası validasyonu için jquery + js
// * TC. kimlik numaraları 11 basamaklı olup, sadece rakamlardan oluşur. İlk 9 rakam arasındaki formül 10.cu rakamı, ilk 10 rakam arasındaki formülasyon ise 11.ci rakamı oluşturur.
// * İlk rakam 0 olamaz.
// * 1,3,5,7 ve 9.cu hanelerin toplamının 7 ile çarpımından 2,4,6, ve 8. haneler çıkartıldığında geriye kalan sayının 10'a göre modu 10. haneyi verir. (çıkarma işleminden elde edilen sonucun 10'a bölümünden kalan)
// * 1,2,3,4,5,6,7,8,9 ve 10. sayıların toplamının 10'a göre modu (10'a bölümünden kalan) 11. rakamı sağlar.
if($('#inputTck').val().length != 11 || $('#inputTck').val().slice(0,1) == 0) {
window.alert('TC Kimlik No hatalı');
return false;
}
{
"categories": [
{
"name": "Movies",
"hls":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/hls/",
"dash":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/dash/",
"mp4":"",
"images":"http",
"tracks":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/tracks/",
"videos": [
{
"categories": [
{
"name": "Movies",
"hls":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/hls/",
"dash":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/dash/",
"mp4":"",
"images":"",
"tracks":"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/tracks/",
"videos": [
pragma solidity ^0.4.11;
/* import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; */
/// @title Contract to bet Ether for a number and win randomly when the number of bets is met.
/// @author Merunas Grincalaitis
contract Casino {
/* is usingOraclize */
address owner;
import subprocess
def getlndchannels(chanstofix):
cmd = subprocess.Popen(r'"C:\Users\pseudozach\AppData\Local\Node Launcher\lnd\lnd-windows-amd64-v0.5.2-beta\lncli.exe" listchannels', shell=True, stdout=subprocess.PIPE)
chanlist = []
listindex = 0
for line in cmd.stdout:
if b"active" in line:
#line starts
gotline = True

Keybase proof

I hereby claim:

  • I am pseudozach on github.
  • I am zozsoy (https://keybase.io/zozsoy) on keybase.
  • I have a public key ASAQP_BP9ayIqP4vRro1fDBLVIsLBLDKQC1PEvGf4L2Hxgo

To claim this, I am signing this object:

@pseudozach
pseudozach / gist:90035da367a972f21e40260832c6e3c3
Last active September 23, 2021 21:50
create and broadcast op_return data to bitcoin blockchain by using polar and bitcoinjs.
var bitcoin = require('bitcoinjs-lib');
const Client = require('bitcoin-core');
const client = new Client({ network: 'regtest',port: 18443, username: 'polaruser', password: 'polarpass', version: '0.21.1' });
async function sendopreturn() {
try {
const unspentutxos = await client.command('listunspent');
// console.log("unspentutxos: ", unspentutxos);
// get a random UTXO
@pseudozach
pseudozach / getHTLCsabouttoexpire.js
Created November 3, 2021 16:41
Get HTLCs that are about to timeout
var shell = require('shelljs');
let deltablock = 13
// finds the lowest expiration_height across all pending HTLCs
let nearesttimeout = shell.exec("lncli listchannels | jq '.[][] | .pending_htlcs[] | .expiration_height ' | sort -n | head -1").stdout.trim();
let currentblockheight = shell.exec("lncli getinfo | jq '.block_height'").stdout.trim();
console.log(`nearesttimeout, currentblockheight `,nearesttimeout, currentblockheight);
if(nearesttimeout - currentblockheight < deltablock) {
console.log(`timeout is within ${deltablock}`)
}
@pseudozach
pseudozach / balancemonitor.js
Created November 28, 2021 23:09
Script to check balances of RSK Addresses
var shell = require('shelljs');
var axios = require('axios')
const rskapi = require('rskapi');
const client = rskapi.client('https://public-node.rsk.co:443') // rsk mainnet public node
var mgapikey = 'mgapikey';
var domain = 'mg.domain.com';
var mailgun = require('mailgun-js')({apiKey: mgapikey, domain: domain});
const mil = 1000000;