I hereby claim:
- I am tonkla on github.
- I am tonkla (https://keybase.io/tonkla) on keybase.
- I have a public key ASDrxFwTdCyuuJHtwdhv4JQXe6Nfmv79AU9wnjHidGf-AQo
To claim this, I am signing this object:
| #! /usr/bin/env thor | |
| require 'mysql2' | |
| class Tonkla < Thor | |
| desc 'migrate', 'migrate tonkla.com\'s blog posts from Drupal to Rails' | |
| def migrate | |
| db_from = Mysql2::Client.new(host: 'localhost', username: 'root', database: 'tonkla_com') | |
| db_to = Mysql2::Client.new(host: 'localhost', username: 'root', database: 'klass_blog_development') | |
| result = db_from.query('SELECT r.title, r.body, n.created AS created_at, r.timestamp AS updated_at |
| require 'rubygems' | |
| require 'erb' | |
| require 'mysql2' | |
| require 'thor' | |
| class Blogelf < Thor | |
| desc 'migrate', 'Migrate from MySQL to Markdown text file (Jekyll)' | |
| def migrate | |
| Dir.mkdir('_posts') unless Dir.exist?('_posts') | |
| db = Mysql2::Client.new(host: 'localhost', username: 'root', database: 'blogelf') |
| func Round(num float64, precision uint) float64 { | |
| pow := math.Pow(10, float64(precision)) | |
| n := int((num * pow) + math.Copysign(0.5, num)) | |
| return float64(n) / pow | |
| } |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| if [ "$#" == "0" ]; then | |
| echo "You need to supply at least one argument!" | |
| exit 1 | |
| fi | |
| DOMAINS=('.com' '.net' '.org') | |
| ELEMENTS=${#DOMAINS[@]} |
| import { Directive, ElementRef, Input, OnInit } from '@angular/core'; | |
| import { Http, Headers, RequestOptionsArgs, ResponseContentType } from '@angular/http'; | |
| import { AuthenticationService } from '../services'; | |
| @Directive({ selector: '[httpSrc]' }) | |
| export class HttpSrcDirective implements OnInit { | |
| @Input('httpSrc') url: string; | |
| constructor(private el: ElementRef, private http: Http, private authService: AuthenticationService) {} |
| FROM ubuntu:16.04 | |
| # Install required libraries | |
| RUN apt-get update &&\ | |
| apt-get upgrade -y &&\ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential python-software-properties wget autoconf git-core curl \ | |
| zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev \ | |
| libcurl4-openssl-dev libffi-dev |
| // Credit: https://gist.github.com/felixjung/a00879103892af44524f | |
| // Credit: https://gist.github.com/emcmanus/eb735299788c820b4eb85c38f02598e4 | |
| import { | |
| camelCase, | |
| cloneDeep, | |
| isArray, | |
| isPlainObject, | |
| map, | |
| mapKeys, |
| 'use strict' | |
| const Busboy = require('busboy') | |
| const XLSX = require('xlsx') | |
| function parseMultipartFormData(input, contentType) { | |
| return new Promise((resolve, reject) => { | |
| const buffers = [] | |
| const busboy = new Busboy({ | |
| headers: { 'content-type': contentType }, |
| import { createContext, useContext, useCallback, useState } from 'react' | |
| const AppContext = createContext({}) | |
| const useAppContext = () => { | |
| return useContext(AppContext) | |
| } | |
| const useAppState = () => { | |
| const initialState = { count: 0 } |