Skip to content

Instantly share code, notes, and snippets.

View dypsilon's full-sized avatar

Tim Navrotskyy dypsilon

View GitHub Profile
@dypsilon
dypsilon / SassMeister-input.scss
Created February 4, 2015 19:36
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
/*------------------------------------*\
$CSSWIZARDRY-GRIDS
\*------------------------------------*/
/**
* CONTENTS
@dypsilon
dypsilon / SassMeister-input.scss
Created February 4, 2015 20:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
/*------------------------------------*\
* $CSSWIZARDRY-GRIDS
*\*------------------------------------ */
/**
* CONTENTS
@dypsilon
dypsilon / highland_readdirp.js
Last active August 29, 2015 14:24
Recursive readdir using highland streams.
/**
* This function takes a directory path and returns a flat stream
* with stat objects + full file path in the .path property.
*/
var path = require('path');
var h = require('highland');
var readdir = h.wrapCallback(require('fs').readdir);
var stat = h.wrapCallback(require('fs').stat);
@dypsilon
dypsilon / css3-reset.css
Created April 19, 2011 22:16
CSS3 Reset
/* via http://blog.mostof.it/a-basic-css3-reset/ */
/* had no opportunity to use it yet */
* { outline: 0; }
html, body { min-height: 100%; }
body, ul, ol, dl { margin: 0; }
img { border: 0; }
article, aside, audio, footer, header, nav, section, video { display: block }
input[type="submit"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner { border : 0px; }
input[type="search"] { -webkit-appearance: textfield; }
@dypsilon
dypsilon / gist:961343
Created May 8, 2011 12:33
Explaned to a friend how to use loops in java.
public void printAccounts() {
for (int i = 0; i < accounts.length; i++) {
// schleifenlogik
Account currentAccount = accounts[i];
Customer owner = currentAccount.getOwner();
Integer id = currentAccount.getId();
@dypsilon
dypsilon / index.php
Created May 31, 2011 22:49
Installing Zend Framework strategically (goo.gl/LQ5qO) / index.php
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Configure the include path.
$zendFrameworkPath = realpath(APPLICATION_PATH . '/../../zf/1.11.6');
if ($zendFrameworkPath === false) {
@dypsilon
dypsilon / BadExample.php
Created June 4, 2011 23:09
The power of empty
<?php
if(isset($someArray) && is_array($someArray)
&& array_key_exists('firstKey', $someArray)
&& array_key_exists('secondKey', $someArray['firstKey'])
&& array_key_exists('thirdKey', $someArray['firstKey']['secondKey'])) {
echo $someArray['firstKey']['secondKey']['thirdKey'];
}
@dypsilon
dypsilon / TheSolution.php
Created June 4, 2011 23:19
The power of empty
if(!empty($someArray['firstKey']['secondKey']['thirdKey'])) {
echo $someArray['firstKey']['secondKey']['thirdKey'];
}
@dypsilon
dypsilon / TheSolution.php
Created June 4, 2011 23:19
The power of empty
<?php
if(!empty($someArray['firstKey']['secondKey']['thirdKey'])) {
echo $someArray['firstKey']['secondKey']['thirdKey'];
}
@dypsilon
dypsilon / ConfigurationUseCase.php
Created June 4, 2011 23:26
The power of empty
<?php
$configuration = array(
'projectName' => 'double-ypsilon',
'useCaching' => true,
);