Skip to content

Instantly share code, notes, and snippets.

Avatar

tomasz stryjewski stryju

View GitHub Profile
View either.php
function either() {
foreach ( func_get_args() as $arg ){
if ( is_string( $arg ) ? !! trim( $arg ) : !! $arg ) {
return $arg;
}
}
return false;
}
@stryju
stryju / settings.json
Created Sep 24, 2013
sublime settings
View settings.json
{
"bold_folder_labels": true,
"color_scheme": "Packages/Dayle Rees Color Schemes/Peacock.tmTheme",
"default_line_ending": "unix",
"draw_minimap_border": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"flatland_sidebar_tree_small": true,
"flatland_square_tabs": false,
"folder_exclude_patterns":
View commenter.js
var comments = [];
function digDeeper( el, i ){
if ( el.nodeType === 8 ){
comments.push( el.nodeValue.replace( /^\s*|\s*$/g, '' ));
return;
}
if ( ! el || ! el.childNodes || ! el.childNodes.length ){
return;
@stryju
stryju / _normalize_custom.scss
Created Mar 28, 2013
custom normalize - normalize the things you NEED
View _normalize_custom.scss
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
/*
* usage:
* @import "normalize_custom";
*
* // this will print out ALL selectors
* @include normalize();
*
* // this will print out minimal set (*) -- you can see the list of "excluded" tags below
@stryju
stryju / _missing_zurb_push-pull.scss
Created Mar 20, 2013
missing zurb push / pull classes
View _missing_zurb_push-pull.scss
// the missing push/pull classes:
.push-1 {
right: auto;
left: (1/12) * 100%;
}
.pull-1 {
right: (1/12) * 100%;
left: auto;
}
@stryju
stryju / actual_output.css
Last active Dec 14, 2015
sass selector-placeholders order - bug or feature? :|
View actual_output.css
.foo {
color:red
}
.bar {
color:blue
}
@stryju
stryju / _sprite-placeholder.scss
Last active Dec 14, 2015
sprite placeholder generator still in development, expect performance tweaks and some clean-up
View _sprite-placeholder.scss
@mixin sprite-placeholders( $glob, $dimensions: true, $layout: smart ){
$map : sprite-map( $glob, $layout : $layout );
$name : sprite-map-name( $map ) + '-sprite';
$widths : ();
$heights : ();
$unified-widths : false;
$unified-heights : false;
View jquery.form_object.js
;( function( $, window, document, undefined ){
"use strict";
$.fn.formObject = function( data ){
if ( data ){
this.each( function(){
// we do it only for forms
if ( ! /form/i.test( this.tagName )){
return false;
}
View caret.js
function caretInception( node, index, found ){
var response = {
found : found,
index : index
};
if ( found ) {
return response;
}
View gist:4072386
{
"auto_complete_commit_on_tab": false,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",