Skip to content

Instantly share code, notes, and snippets.

View kostasx's full-sized avatar
💭
Uncaught ReferenceError

Kostas Minaidis kostasx

💭
Uncaught ReferenceError
View GitHub Profile
@kostasx
kostasx / gfont.sublime-snippet
Created October 17, 2012 17:27
Embed Google Web Font 'Opens Sans' for Latin & Greek Alphabet using gfont:full trigger
<snippet>
<content>
<![CDATA[
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,700,300,800,600&subset=latin,greek' rel='stylesheet' type='text/css'>
<style type="text/css">
* { font-family: 'Open Sans', Arial, sans-serif; font-weight: 400; }
</style>
]]>
</content>
<tabTrigger>gfont:full</tabTrigger>
<snippet>
<content><![CDATA[
@font-face { font-family: 'IconicFill'; src: url('iconic_fill.eot'); src: url('iconic_fill.eot?#iefix') format('embedded-opentype'), url('iconic_fill.ttf') format('truetype'), url('iconic_fill.svg#iconic') format('svg'); font-weight: normal; font-style: normal; }.iconic { display:inline-block; font-family: 'IconicFill'; }.lightbulb:before {content:'\e063';}.equalizer:before {content:'\e052';}.brush_alt:before {content:'\e01c';}.move:before {content:'\e03e';}.tag_fill:before {content:'\e02b';}.book_alt2:before {content:'\e06a';}.layers:before {content:'\e01f';}.chat_alt_fill:before {content:'\e007';}.layers_alt:before {content:'\e020';}.cloud_upload:before {content:'\e045';}.chart_alt:before {content:'\e029';}.fullscreen_exit_alt:before {content:'\e051';}.cloud_download:before {content:'\e044';}.paperclip:before {content:'\e08a';}.heart_fill:before {content:'\2764';}.mail:before {content:'\2709';}.pen_alt_fill:before {content:'\e005';}.check_alt:before {content:'\2718';}.battery_ch
@kostasx
kostasx / .bash_aliases
Created October 20, 2012 19:27
Linux Server Administrator useful aliases
# Edit your ~/.bash_aliases file:
### Live monitoring of Apache2 web server access logs
alias tlog='tail -f /var/log/apache2/access.log';
### Live monitoring of Apache2 web server error logs
alias terr='tail -f /var/log/apache2/error.log';
@kostasx
kostasx / document_ready.sublime-snippet
Created October 24, 2012 00:28
Sublime Text 2 Snippet: jQuery Document Ready
<snippet>
<content><![CDATA[
\$(function(){
${1}
});
]]></content>
<tabTrigger>$.ready</tabTrigger>
</snippet>
@kostasx
kostasx / console_log.sublime-snippet
Created October 27, 2012 01:14
Sublime Text 2 Snippet: JavaScript console.log shortcut
<snippet>
<content>
<![CDATA[
console.log(${1:this});
]]></content>
<tabTrigger>clog</tabTrigger>
</snippet>
@kostasx
kostasx / jqueryui-cdn.sublime-snippet
Created October 30, 2012 23:30
Sublime Text 2 Snippet: jQuery UI Google CDN
<snippet>
<content>
<![CDATA[
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.css"/>
]]>
</content>
<tabTrigger>jqui:cdn</tabTrigger>
</snippet>
@kostasx
kostasx / lomo.sh
Created December 17, 2012 23:08
Apply a lomo effect to an image using ImageMagick. ( Requirements: ImageMagick + "curves" script by Fred Weinhaus: http://www.fmwconcepts.com/imagemagick/curves/index.php )
#!/bin/bash
## Split Image into Separate RGB Channels
convert -channel R -separate $1 tmpR.bmp
convert -channel G -separate $1 tmpG.bmp
convert -channel B -separate $1 tmpB.bmp
## Apply Curves Transformation on Each Channel (Lomo Effect)
@kostasx
kostasx / Greek_to_slug.js
Last active December 16, 2022 09:03
Convert greek strings to URL slugs in JavaScript.
function string_to_slug(str) {
str = str.replace(/^\s+|\s+$/g, '') // TRIM WHITESPACE AT BOTH ENDS.
.toLowerCase(); // CONVERT TO LOWERCASE
const from = [ "ου", "ΟΥ", "Ού", "ού", "αυ", "ΑΥ", "Αύ", "αύ", "ευ", "ΕΥ", "Εύ", "εύ", "α", "Α", "ά", "Ά", "β", "Β", "γ", "Γ", "δ", "Δ", "ε", "Ε", "έ", "Έ", "ζ", "Ζ", "η", "Η", "ή", "Ή", "θ", "Θ", "ι", "Ι", "ί", "Ί", "ϊ", "ΐ", "Ϊ", "κ", "Κ", "λ", "Λ", "μ", "Μ", "ν", "Ν", "ξ", "Ξ", "ο", "Ο", "ό", "Ό", "π", "Π", "ρ", "Ρ", "σ", "Σ", "ς", "τ", "Τ", "υ", "Υ", "ύ", "Ύ", "ϋ", "ΰ", "Ϋ", "φ", "Φ", "χ", "Χ", "ψ", "Ψ", "ω", "Ω", "ώ", "Ώ" ];
const to = [ "ou", "ou", "ou", "ou", "au", "au", "au", "au", "eu", "eu", "eu", "eu", "a", "a", "a", "a", "b", "b", "g", "g", "d", "d", "e", "e", "e", "e", "z", "z", "i", "i", "i", "i", "th", "th", "i", "i", "i", "i", "i", "i", "i", "k", "k", "l", "l", "m", "m", "n", "n", "ks", "ks", "o", "o", "o", "o", "p", "p", "r", "r", "s", "s", "s", "t", "t", "y", "y", "y", "y", "y", "y", "y", "f", "f", "x", "x", "ps", "ps", "o",
@kostasx
kostasx / CSS Un-Minify Script
Created January 18, 2014 16:18
A simple (sloppy) python script to un-minify CSS. Live Python demo here: http://pythonfiddle.com/css-unminifier-script
import re
# Sample CSS minified code from Bootstrap
minified_css = 'article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:0 0}'
unminified_css = re.sub("\{", " {\n\r\n\r\t", minified_css)
unminified_css = re.sub("\}", "\n\r\n\r}\n\r\n\r", unminified_css)
unminified_css = re.sub(";", ";\n\r\t", unminified_css)
print unminified_css
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);