Skip to content

Instantly share code, notes, and snippets.

View noinstance's full-sized avatar

noinstance noinstance

View GitHub Profile
-- generate password in cli
-- openssl rand -base64 16
create database dbname;
create user 'username'@'localhost' identified by 'password';
grant all privileges on dbname.* to 'username'@'localhost';
flush privileges;
@noinstance
noinstance / unique_chars_from_array.php
Last active August 29, 2015 14:18
Get unique characters in array of strings
# http://stackoverflow.com/questions/29516239
$all_characters = implode('', $person_array);
$unique_characters = [];
foreach($all_characters as $char) {
if(!in_array($char, $unique_characters)) {
$unique_characters[] = $char;
}
}
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-app="fApp">
<div ng-controller="FlickController">