This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
Author: | Baiju Muthukadan |
---|---|
Email: | baiju.m.mail AT gmail.com |
Version: | 0.3.2 |
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
- install packages for vim, git
- create user accounts, as specified in included JSON config files
- install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository
Afterwards, we'll see how easy it is to package our newly provisioned VM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# build the environment | |
mkdir tessenv; cd tessenv | |
TROOT=`pwd` | |
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng | |
echo "Environment built" | |
# Get the stock english fonts from Google (old, but they work) | |
cd $TROOT/stockfonts | |
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 Julian Shen | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import android.graphics.Bitmap.Config; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.graphics.Shader; | |
// enables hardware accelerated rounded corners | |
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/ |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
Steps to make a Fragment or View to have a Callback to its parent Activity.
Step by step from info taken from here:
http://developer.android.com/guide/components/fragments.html#CommunicatingWithActivity
- We have an Activity that hosts a Fragment or a View
- We have a Fragment or View with a ListView or a Button or some element that we want the Activity to know about. i.e. we load detailed info of an element chosen on a ListView or something.
OlderNewer