Skip to content

Instantly share code, notes, and snippets.

View NerdGr8's full-sized avatar

Nerudo Mregi NerdGr8

View GitHub Profile
@NerdGr8
NerdGr8 / mysql2sqlite.sh
Created March 6, 2019 06:47 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/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
@NerdGr8
NerdGr8 / home-brew-mysql-essential-commands
Created November 15, 2018 11:15 — forked from jasperf/home-brew-mysql-essential-commands
Homebrew Create a MySQL database and user to be used for a WordPress site from the command line with mysql and restart server when you have a socket error or other error #wordpress #mysql #homebrew
//homebrew mysql start
/usr/local/Cellar/mysql/5.6.19/bin/mysql.server restart
//or
mysql.server start
//check for access privileges
mysqlaccess localhost user database
@NerdGr8
NerdGr8 / GetWeeksInMonth.js
Created July 11, 2018 19:52 — forked from markthiessen/getWeeksInMonth.js
JavaScript - get weeks in a month as array of start and end days
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(month, year){
var weeks=[],
firstDate=new Date(year, month, 1),
lastDate=new Date(year, month+1, 0),
numDays= lastDate.getDate();
var start=1;
var end=7-firstDate.getDay();
while(start<=numDays){
@NerdGr8
NerdGr8 / get_barcode_from_image.js
Created May 24, 2012 12:38 — forked from tobitailor/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',