Skip to content

Instantly share code, notes, and snippets.

View venkat-bitla's full-sized avatar
☺️

Venkat Bitla venkat-bitla

☺️
  • paage
  • Hyderabad
View GitHub Profile
This is a simple way of importing MySQL database in Docker.
In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.
Put the exported sql file in the shared folder.
Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.
Login to MySQL via mysql -u USERNAME -p.
@venkat-bitla
venkat-bitla / epochToDate.js
Last active August 29, 2015 14:21
epoch to date
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
ampm = 'AM',
time;
@venkat-bitla
venkat-bitla / Repeating strings
Created January 31, 2012 14:39
Repeating strings with javascript array
Array(30).join("-");