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
@neko-fire
neko-fire / post messages
Created March 12, 2018 15:19
post messages events listener for iframes
function msg(event){
console.log(event);
}
window.addEventListener('message', function(e{
console.log(e);
}));
@neko-fire
neko-fire / webpack watch timestamp
Created August 16, 2016 16:15
adding timestamp to webpack --watch
// add this to webpack config in plugin section
plugins: [
function() {
this.plugin('watch-run', function(watching, callback) {
console.log('Begin compile at ' + new Date());
callback();
})
}
]
@neko-fire
neko-fire / countdown.js
Created August 4, 2016 07:48
countdown & bg changer
$(function () {
var main = [];
var colors = ['#19ba5a', '#3c82f6', '#e93750', '#29353a', '#9449b3', '#ffdb00'];
var interval_time = 5000;
$('.main').each(function () {
main.push($(this).prop('id'));
});
var body = $('body');
@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 / Full Path in Mac Finder title bar
Last active December 2, 2015 10:11
Mac show path in Finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
killall Finder
@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 / 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 / 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 / general .gitignore
Last active October 6, 2017 14:59
standard .gitignore file
# IDES & Editors
# --------------------
.settings/
.buildpath
.project
.idea/
nbproject/
gitupdate
gitignore
*~
@neko-fire
neko-fire / Delivery date shopify
Created April 14, 2014 19:38
add to js and cart page
{{ 'http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
{{ '//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js' | script_tag }}
<div style="width:300px; clear:both;">
<p>
<label for="date">Pick a delivery date:</label>
<input id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" />
<span style="display:block" class="instructions"> We do not deliver during the week-end.</span>
</p>
</div>