sudo /usr/local/mysql/support-files/mysql.server stop
sudo mysqld_safe --skip-grant-tables
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES;
This file contains hidden or 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
public function add(\Slim\Middleware $newMiddleware) | |
{ | |
if(in_array($newMiddleware, $this->middleware)) { | |
$middleware_class = get_class($newMiddleware); | |
throw new \RuntimeException("Circular Middleware setup detected. Tried to queue the same Middleware instance ({$middleware_class}) twice."); | |
} | |
$newMiddleware->setApplication($this); | |
$newMiddleware->setNextMiddleware($this->middleware[0]); | |
array_unshift($this->middleware, $newMiddleware); | |
} |
This file contains hidden or 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
sql_query_pre = SET @x = 0 | |
# Since we have a uuid as an id, we need to swap that out | |
# for an integer | |
sql_query = \ | |
SELECT \ | |
@x := @x + 1 as id, user_id, type, name, email, browser, question, unix_timestamp(created) as created \ | |
FROM \ | |
contacts |
This file contains hidden or 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 hashlib | |
import os | |
import urllib.request | |
pf = 'Package Control.sublime-package' | |
packages_path = sublime.installed_packages_path() | |
proxy_handler = urllib.request.ProxyHandler() | |
opener = urllib.request.build_opener(proxy_handler) | |
urllib.request.install_opener(opener) |
This file contains hidden or 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 | |
pre=$(basename $0) | |
# the -d flag makes a directory in place of a file | |
# the -t flag uses the pre variable as a template | |
dir=$(mktemp -dt ${pre}) | |
getmap() { | |
# Make sure we have both a map name and key |
This file contains hidden or 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
source base | |
{ | |
type = mysql | |
sql_host = localhost | |
sql_user = root | |
sql_pass = root | |
sql_db = lookbooks_live | |
sql_port = 3306 | |
} |
sudo /usr/local/mysql/support-files/mysql.server stop
sudo mysqld_safe --skip-grant-tables
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES;
This file contains hidden or 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
/////////////////////////////////////////////// | |
// This is all you need. Just add the following | |
// into a file called Caddyfile. | |
// | |
// Then just run `caddy` | |
// | |
// This example assumes ./public/index.php | |
/////////////////////////////////////////////// | |
localhost:9999 { |
This file contains hidden or 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
int main() | |
{ | |
int dsize, saddr_size; | |
struct sockaddr saddr; | |
struct in_addr in; | |
unsigned char *buf = (unsigned char *)malloc(65536); | |
if((raw_socket = socket(AF_INET , SOCK_RAW , IPPROTO_TCP) < 0) | |
{ |
This file contains hidden or 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
<?php | |
function isValid($string) { | |
if (ctype_alpha($string)) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
// This returns true, just letters |