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:
// Credit: https://gist.github.com/felixjung/a00879103892af44524f | |
// Credit: https://gist.github.com/emcmanus/eb735299788c820b4eb85c38f02598e4 | |
import { | |
camelCase, | |
cloneDeep, | |
isArray, | |
isPlainObject, | |
map, | |
mapKeys, |
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 |
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) {} |
#!/bin/bash | |
if [ "$#" == "0" ]; then | |
echo "You need to supply at least one argument!" | |
exit 1 | |
fi | |
DOMAINS=('.com' '.net' '.org') | |
ELEMENTS=${#DOMAINS[@]} |
I hereby claim:
To claim this, I am signing this object:
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 | |
} |
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') |
#! /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 |