Skip to content

Instantly share code, notes, and snippets.

@roine
roine / gshow.sh
Created December 18, 2012 06:22
pretty git show
git show --pretty="format:" --name-only HEAD
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.8.3",function($,L){$('form').submit(function () {if($(".jon-submit:checkbox").is(":checked")){return;}var $that = $(this),formWidth = $(this).width(),checkbox = $(document.createElement('input')).prop('type', 'checkbox').addClass('jon-submit').css({'width': 22,'float': 'none','height': 17,margin:0,padding:0,'font-size':12}),checkboxWrapper = $(document.createElement('div')).append(checkbox).append("Submit form").css({'background':'white','width': formWidth,'z-index':2000,'padding':'2px 10px','margin':'2px 0','border-radius':3,'border':'1px solid silver','text-align':'center','box-shadow': '0 0 5p
@roine
roine / demo.html
Last active December 11, 2015 16:59
<style>
kbd {
padding: 0.1em 0.6em;
border: 1px solid #ccc;
font-size: 11px;
font-family: Arial,Helvetica,sans-serif;
background-color: #f7f7f7;
color: #333;
-moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;
[
{ "keys": ["f12"], "command": "reindent"},
{ "keys": ["ctrl+shift+f12"], "command": "delete_trailing_spaces" }
]
<?php
// create post type
add_action( 'init', 'create_post_type' );
function create_post_type() {
$conf = array(
'public' => true,
'has_archive' => true,
'menu_position' => 5,
@roine
roine / functions.php
Last active December 14, 2015 15:08
add post to nav menu
<?php
add_action( 'add_meta_boxes', 'add_custom_box_wpse_87594' );
add_action( 'save_post', 'save_postdata_wpse_87594', 10, 2 );
function add_custom_box_wpse_87594()
{
add_meta_box(
'section_id_wpse_87594',
__( 'Available Nav-Menus' ),
'inner_custom_box_wpse_87594',
@roine
roine / dropshadows.css
Created March 12, 2013 09:14
my stylish drop shadows
.effect1 {
box-shadow: 0 10px 6px -6px #777777;
}
.effect2 {
position: relative;
}
.effect2:before,.effect2:after {
background: none repeat scroll 0 0 #777777;
bottom: 15px;
@roine
roine / dabblet.css
Created March 18, 2013 01:31 — forked from LeaVerou/dabblet.css
iOS 6 style switch checkboxes
/**
* iOS 6 style switch checkboxes
* by Lea Verou http://lea.verou.me
*/
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */
position: absolute;
opacity: 0;
}
@roine
roine / dabblet.css
Created March 22, 2013 03:21 — forked from LeaVerou/dabblet.css
MathML with CSS fallback
/**
* MathML with CSS fallback
*/
math {
font-family: 'Cambria Math', Cambria, MathJax_Main,
STIXGeneral, DejaVu Serif, DejaVu Sans,
Times, Lucida Sans Unicode, OpenSymbol,
Standard Symbols L, serif;
}