Skip to content

Instantly share code, notes, and snippets.

View elmariachi111's full-sized avatar
🦄
meow

Stefan Adolf elmariachi111

🦄
meow
View GitHub Profile
@elmariachi111
elmariachi111 / README.md
Last active January 4, 2018 14:10
Cryptocurrency Exchange tickers using ccxt

Cryptocurrency Exchange tickers using ccxt

queries tickers from various cryptocurrency exchanges. See https://github.com/ccxt/ccxt for all resources

┌───────────────┬───────────────┬───────────────┬──────────────┬───────────────┐
│ Exchange      │ BTC/EUR       │ ETH/EUR       │ LTC/EUR      │ XMR/EUR       │
├───────────────┼───────────────┼───────────────┼──────────────┼───────────────┤
│ coinmarketcap │ 12150.4880623 │ 817.591620461 │ 193.38186035 │ 326.259801595 │
├───────────────┼───────────────┼───────────────┼──────────────┼───────────────┤
@elmariachi111
elmariachi111 / seed.js
Created January 28, 2018 21:44
create a iota seed in plain js
function createSeed(){
const seedsize = 81;
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9";
let seed = "";
for (var i = 0, n = chars.length; i < seedsize; ++i) {
seed += chars.charAt(Math.floor(Math.random() * n));
}
return seed;
}
Verifying my Blockstack ID is secured with the address 1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7 https://explorer.blockstack.org/address/1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7
Verifying my Blockstack ID is secured with the address 1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7 https://explorer.blockstack.org/address/1N9A6gny5PTDiZ1JYZbWbgAskSWTyMuvS7
@elmariachi111
elmariachi111 / index.jsx
Last active March 6, 2018 00:55
blockstagram / index.jsx
const blockstack = require( 'blockstack' );
const { getPublicKeyFromPrivate } = require('blockstack');
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption')
...
class App extends React.Component {
constructor() {
super()
this.state = {
@elmariachi111
elmariachi111 / SigninButton.jsx
Created March 5, 2018 17:45
blockstagram / SigninButton.jsx
import React from 'react';
import * as blockstack from 'blockstack'
export default class SigninButton extends React.Component {
onClick (evt) {
evt.preventDefault();
if (this.props.userData) {
blockstack.signUserOut('/');
} else {
@elmariachi111
elmariachi111 / encryption.js
Last active March 6, 2018 01:20
blockstagram / key generation & manual encryption
import SimpleCryptoJS from 'simple-crypto-js'
const blockstack = require( 'blockstack' );
const { getPublicKeyFromPrivate } = require('blockstack');
const { encryptECIES, decryptECIES } = require('blockstack/lib/encryption')
...
class App extends React.Component {
componentDidMount() {
@elmariachi111
elmariachi111 / SendMailCommand.php
Created October 19, 2018 18:00
PHP / Symfony: create zip file mail attachments in memory
<?php
namespace App\Command;
use Badcow\LoremIpsum\Generator;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use ZipStream\ZipStream;

how to extend vue cli with webpack loader

have fun using this

@elmariachi111
elmariachi111 / truncate.js
Created June 19, 2019 18:54
Javascript: truncate a text along punctuation marks
/*
assume you want to truncate a longer text to a certain amount of characters but you don't want to stop at
word boundaries. Instead lets cut the text at sentence ending punctuation marks like ! ? .
*/
function pos(str, char) {
let pos = 0
const ret = []
while ( (pos = str.indexOf(char, pos + 1)) != -1) {
ret.push(pos)