Skip to content

Instantly share code, notes, and snippets.

View neko-fire's full-sized avatar
💭
Save the princess

Martin neko-fire

💭
Save the princess
  • Germany / Philippines
View GitHub Profile
PS1="\[\e[00;34m\]\t\[\e[0m\]\[\e[00;37m\] \u@\h:[\[\e[0m\]\[\e[00;32m\]\w\[\e[0m\]\[\e[00;37m\]]\[\e[0m\]\[\e[00;36m\]\$\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
@neko-fire
neko-fire / Mysql user reset
Created March 5, 2014 10:18
Reset mysql user password, needs to be run in save mode.
INSERT INTO mysql.user
SET user = 'root',
host = 'localhost',
password = Password('wwPmz59DyjPYqa'),
super_priv = 'y',
select_priv = 'y',
insert_priv = 'y',
update_priv = 'y',
delete_priv = 'y',
create_priv = 'y',
@neko-fire
neko-fire / shell commands debian
Last active August 29, 2015 14:02
useful commands
ps auxww | grep php5-cgi #-- is the process running?
netstat -an | grep 9000 # is the port open?
# SQL server type
SHOW VARIABLES LIKE "%version%"
@neko-fire
neko-fire / nginx-config-prestashop
Created June 23, 2014 21:20
nginx 1.4.1 prestashop 1.6 rewrites
rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last;
rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
rewri
@neko-fire
neko-fire / watch mysql operations
Created July 23, 2014 11:30
watch mysql operations in console
watch -n 0.5 "mysqladmin processlist"
@neko-fire
neko-fire / underline text
Created October 6, 2014 13:41
Underline styles from Medium.com
text-decoration: none;
background-image: -moz-linear-gradient(top, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 50%);
background-image: -webkit-linear-gradient(top, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 50%);
background-image: -o-linear-gradient(top, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 50%);
background-image: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 50%);
background-repeat: repeat-x;
background-size: 2px 2px;
background-position: 0 24px; /* font-size 22px */
@neko-fire
neko-fire / gist:2583933
Created May 3, 2012 07:11
JavaScript: skeleton anonymous function
(function(){
// write js here
})();
@neko-fire
neko-fire / gist:2583930
Created May 3, 2012 07:10
JavaScript: jQuery: doc ready short form
$(function(){
// type jquery code here
});
@neko-fire
neko-fire / gist:2583925
Created May 3, 2012 07:10
C: Skeleton template
#include <stdio.h>
int main()
{
}
@neko-fire
neko-fire / gist:2583942
Created May 3, 2012 07:12
HTML5: Skeleton template
<!doctype html>
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">