Skip to content

Instantly share code, notes, and snippets.

@Katafalkas
Katafalkas / hashFileSha3_256.js
Created February 20, 2021 16:55
File hashing
const fs = require('fs').promises;
const { SHA3 } = require('sha3');
const imageHash = async (imageFilePath) => {
const fileContent = await fs.readFile(imageFilePath);
const base64FileContent = fileContent.toString('base64');
const hash = SHA3(256);
hash.update(base64FileContent);
return hash.digest({ buffer: Buffer.alloc(32), format: 'hex' });
};
0x2611a2A8489b104BE82d31f5dc4118a5Af1eAA69
@Katafalkas
Katafalkas / gist:1a35957637ca39a953679d2c02c67105
Last active December 10, 2017 13:53
carvertical-bitcointalk.bbcode
[center]
[url=https://www.carvertical.com/][size=30pt][color=#121d36]car[color=#fe832e]|[/color]Vertical[/color][/size]
[size=16pt]www.carvertical.com[/size][/url]
[size=20pt][color=#121d36][b][url=https://www.carvertical.com/carvertical-whitepaper.pdf][color=#121d36]Whitepaper[/color][/url]
[color=#aaa]▬▬▬▬▬[/color]
[url=https://youtu.be/pHZ6w42HjJo][color=#121d36]Explainer Video[/color][/url]
[color=#aaa]▬▬▬▬▬[/color]
[url=https://youtu.be/XtXoAPNsw5Y][color=#121d36]Video FAQ[/color][/url][/b][/color][/size]
0x014fC07130aAc3aD4C057183EF39eCB82619c077
*Tunnelblick: OS X 10.12.3; Tunnelblick 3.7.0 (build 4790); Admin user
git commit 8c2e63a08fd49c4b4881925fea8282547bf2de25
Configuration foo@foo
"Sanitized" condensed configuration file for /Users/foo/Library/Application Support/Tunnelblick/Configurations/foo@foo.tblk:
resolv-retry infinite
ca ca.crt
*Tunnelblick: OS X 10.12.3; Tunnelblick 3.7.0 (build 4790)
2017-03-28 17:34:07 *Tunnelblick: Attempting connection with foo@bar using shadow copy; Set nameserver = 769; monitoring connection
2017-03-28 17:34:07 *Tunnelblick: openvpnstart start foo@bar.tblk 1338 769 0 1 0 1065264 -ptADGNWradsgnw 2.3.14-openssl-1.0.2k
2017-03-28 17:34:07 *Tunnelblick: openvpnstart log:
OpenVPN started successfully. Command used to start OpenVPN (one argument per displayed line):
/Applications/Tunnelblick.app/Contents/Resources/openvpn/openvpn-2.3.14-openssl-1.0.2k/openvpn
--daemon
--log
/Library/Application Support/Tunnelblick/Logs/-SUsers-S123-SLibrary-SApplication Support-STunnelblick-SConfigurations-Sfoo@bar.tblk-SContents-SResources-Sconfig.ovpn.769_0_1_0_1065264.1338.openvpn.log
@Katafalkas
Katafalkas / Implement ZBar in Swift.md
Last active February 2, 2016 19:33
Implementing ZBar Barcode scanner Swift 2.0
import UIKit
import AVFoundation
import GLKit
import OpenGLES
class ViewController: UIViewController, G8TesseractDelegate, AVCaptureVideoDataOutputSampleBufferDelegate {
var tesseract: G8Tesseract!
var label: UILabel!
var imgV: UIImageView!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
BITHockeyManager.sharedHockeyManager().configureWithIdentifier(kHockeyAppId)
BITHockeyManager.sharedHockeyManager().delegate = self
BITHockeyManager.sharedHockeyManager().authenticator.authenticateInstallation()
BITHockeyManager.sharedHockeyManager().startManager()
<...>
return true
}
@Katafalkas
Katafalkas / gist:366a9f62444e4158c061
Created December 13, 2014 18:48
Swift Drawing Bubble Manually. Dynamiv Bubble View class
import UIKit
class MyView1 : UIView {
override func drawRect(rect: CGRect) {
var bubbleColor = UIColor.whiteColor()
bubbleColor.setStroke()
bubbleColor.setFill()
var bubbleSpace = CGRectMake(16.0, self.bounds.origin.y + 2.0, self.bounds.width - 18.0, self.bounds.height - 4.0)
let bubblePath = UIBezierPath(roundedRect: bubbleSpace, cornerRadius: 16.0)