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 / reactday.json
Created November 2, 2019 00:45
ReactDay Schema.org JSON-LD
{
"@context": "http://schema.org",
"@type": "BusinessEvent",
"startDate": "2019-12-06T08:30:00+01:00",
"endDate": "2019-12-06T22:00:00+01:00",
"name": "React Day Berlin 2019",
"url": "https://www.eventbrite.com/e/react-day-berlin-2019-tickets-61442110005",
"image": "https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F61772770%2F80020269147%2F1%2Foriginal.jpg?w=1000\u0026auto=compress\u0026rect=0%2C64%2C1920%2C960\u0026s=ddd233f8f2f07ec16e2b61d55bf9f0ba",
"eventStatus": "EventScheduled",
"offers": [
# -*- coding: utf-8 -*-
"""Cleaning_Feature_engineering.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1cyB8vww3lA0GhABA0mGJluHjfA0VnY5u
"""
from google.colab import drive
@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)

how to extend vue cli with webpack loader

have fun using this

@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;
@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 / 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 / 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 = {
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