View cycle_gridle_states.scss
$statesNames : gridle_get_states_names();
%alignleft,
.alignleft {
float: left;
@each $name in $statesNames {
&--#{$name} {
@include gridle_state($name) {
float: left;
}
View optimize.sh
#! /bin/sh
#this is where your files will be put
mkdir originals
# I run mozjpeg for everyfile in this dir, adding the suffix .tmp, and move the original file in /originals
for f in ./*.jpg;
do
mozjpeg -optimize -outfile $f.tmp $f;
mv $f originals/$f;
View debug.css
/* Add this to your css for debuggin purpose */
body:after {
content: "no mq";
position: fixed;
bottom: 0;
right: 0;
z-index: 999;
padding: 2px 5px;
background-color: rgba(0,0,0,.7);
color: white;
View Position-fixed.js
// Position fixed: pattern: https://github.com/shichuan/javascript-patterns/blob/master/jquery-patterns/window-scroll-event.html#L36
// RequestAnimationFrame Shim
window.animFrame = (function () {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function (callback) {
window.setTimeout(callback, 15);
};
})();
View Get methods of object.js
// Log all the methods of yourFunction object
console.log(Object.getOwnPropertyNames(yourFunction).filter(function (p) {
return typeof yourFunction[p] === 'function';
}));
View endOfLine.sublime-macro
[
{
"args":
{
"extend": false,
"to": "eol"
},
"command": "move_to"
},
{
View iframe.scss
/*
* Responsive video container
* http://www.smashingmagazine.com/2014/02/27/making-embedded-content-work-in-responsive-design/
*/
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
View current-template.php
// Outputs the template used
// Usage: echo get_current_template(true);
// Credits: http://www.kevinleary.net/get-current-theme-template-filename-wordpress/
function define_current_template( $template ) {
$GLOBALS['current_theme_template'] = basename($template);
return $template;
}
function get_current_template( $echo = false ) {
View gist:67dec22f48ad590494ff
{
"bold_folder_labels": true,
"caret_extra_width": 1,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/User/SublimeLinter/predawn (SL).tmTheme",
"copy_with_empty_selection": false,
"drag_text": false,
"draw_minimap_border": true,
"enable_tab_scrolling": true,
View gist:1322d5cdbe574318c975
[
{ "keys": ["ctrl+shift+u"], "command": "sftp_upload_file" },
{ "keys": ["pause"], "command": "sftp_cancel_upload" },
{ "keys": ["f1"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["ctrl+super+k"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+alt+k"], "command": "insert_snippet", "args": {"name": "Packages/User/comment.sublime-snippet"} },
{ "keys": ["shift+f3"], "command": "css_sorter" },
{ "keys": ["ctrl+alt+f"], "command": "use_it" },
{ "keys": ["alt+e"], "command": "insert_snippet", "args": {"contents": "<em>${0:$SELECTION}</em>" } },