Skip to content

Instantly share code, notes, and snippets.

-- Set Root Password
mysqladmin -u root password <YOURNEWPASSWORD>
-- Set / Change MySQL Users Passwords from the Linux Shell
mysqladmin -u <username >-h <host> -p password <newpassword>
-- How To Connect to MySQL
mysql -ur <username> -p
mysql -h <hostname> -u <username> -p

Keybase proof

I hereby claim:

  • I am criso on github.
  • I am cris_o (https://keybase.io/cris_o) on keybase.
  • I have a public key ASDj-vj41D6LRTA8W5IbAbIeo5TQLfZzWh8jh5QOSSjkngo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am criso on github.
  • I am cris_o (https://keybase.io/cris_o) on keybase.
  • I have a public key ASB1XaCZX-wQmkAKvqx8EAq99cRXq2JRfXXWdKjK59ciogo

To claim this, I am signing this object:

const tabBtns = this.state.tabs.map((tab, index) => {
const tabKey = tab.key;
const style = this.buildMotionStyle(tabKey);
const isActive = this.props.selectedTabKey === tabKey;
return (
<Motion style={style} key={index}>
{
({scale, x, cursor, zIndex}) => {
return React.cloneElement(tab, {
@criso
criso / batch-test.js
Created December 27, 2012 23:22
Batch js calls
function randomTime() {
return Math.floor(Math.random() * 100) + 100;
}
function asyncFoo(_callback) {
var err = false;
setTimeout(function() {
_callback({foo: "I am foo"}, err);
}, randomTime());
@criso
criso / time-it.c
Last active December 10, 2015 03:18
Calculate function execution time
#include <time.h>
#include "lib/dbg.h"
void my_function() {
}
int main (int argc, char const* argv[]) {
clock_t begin, end;
double time_spent;
@criso
criso / dbg.h
Created December 24, 2012 23:58
Zed's debug macros in color
#ifndef __dbg_h__
#define __dbg_h
#include <stdio.h>
#include <errno.h>
#include <string.h>
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
@criso
criso / separat-context.js
Created November 16, 2012 15:21
context separation @ded style
(function () {
with (this) {
!function (context) {
context.hello = function (msg) {
alert(msg);
};
@criso
criso / propCheck.js
Created November 16, 2012 15:13
checking existence of props
var props = {
foo: true,
bar: 1,
baz: false
};
if (props.baz) {
console.log("Won't work")
}
@criso
criso / equivalent.js
Created August 24, 2011 14:20 — forked from tj/equivalent.js
example of backbone-style routing with Express
app.get('/help', function(req, res){
res.send('some help');
});
app.get('/search/:query/p:page', function(req, res){
var query = req.params.query
, page = req.params.page;
res.send('search "' + query + '", page ' + (page || 1));
});