Skip to content

Instantly share code, notes, and snippets.

View serveba's full-sized avatar

Sergio Velasco serveba

  • https://exponentiateam.com
  • Valencia, Spain
View GitHub Profile
@serveba
serveba / pp_struct.go
Last active March 2, 2021 11:25
golang struct pretty print
# someStruct is a struct with other structs as fields
# printf will show all the tree struct on a human friendly format
prettyString, _ := json.MarshalIndent(someStruct, "", " ")
fmt.Printf("%s: %s\n", reflect.TypeOf(someStruct).Name(), prettyString)
@serveba
serveba / qrsample.js
Created February 3, 2016 11:42
nodeJS qr code generator example
'use strict';
var QRCode = require('qrcode');
var from = 1;
var to = 100;
/**
* Generates 'to' qr png images with the numbers
*/
for (var i = from; i <= to; i++) {
@serveba
serveba / openssl_commands
Last active September 4, 2017 05:25
base64 encode/decode, encrypt/decrypt, md5, sha1
#Just base64 encode a binary file:
openssl base64 -in file.bin -out file.b64
#Decode the same file
openssl base64 -d -in file.b64 -out file.bin
#Encrypt a file using triple DES in CBC mode using a prompted password:
openssl des3 -salt -in file.txt -out file.des3
#Decrypt a file using a supplied password: