Skip to content

Instantly share code, notes, and snippets.

Roman Ožana OzzyCzech

Block or report user

Report or block OzzyCzech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Marak
Marak / base64.js
Created Feb 8, 2011
An extremely simple implementation of base64 encoding / decoding using node.js Buffers
View base64.js
/*
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
*
* (C) 2010, Nodejitsu Inc.
*
*/
var base64 = exports;
base64.encode = function (unencoded) {
View backup-homebrew.sh
#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
@dnaber-de
dnaber-de / editor_plugin.js
Created Jan 22, 2012
Wordpress TinyMCE Popup-Dialog. German Tutorial on http://dnaber.de/p1477
View editor_plugin.js
// js/editor_plugin.js
/**
* an example tinyMCE Plugin
*/
tinymce.create(
'tinymce.plugins.myPlugin',
{
/**
* @param tinymce.Editor editor
* @param string url
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active Oct 9, 2018
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment
View INSTALLATION.md

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@sepehr
sepehr / get_daterange_timestamps.php
Created Aug 27, 2013
PHP: Get corresponding timestamp boundaries of a daterange
View get_daterange_timestamps.php
<?php
/**
* Generates timestamp bounderies for the passed date range name.
*
* @param string $range Date range name.
*
* @return array
*/
function get_daterange_timestamps($range)
@jaywilliams
jaywilliams / array_to_object.php
Created Dec 16, 2009
Convert a multi-dimensional array into a stdClass object. Pass by reference.
View array_to_object.php
<?php
/**
* Convert a multi-dimensional array into a stdClass object.
*
* Example:
* $values = array('hello'=>'world');
*
* // Convert the array to an object
* array_to_object($values);
*
@simonbingham
simonbingham / gist:3994802
Created Nov 1, 2012
JavaScript: Using HTML5 local storage and jQuery to persist form data
View gist:3994802
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Local Storage Example</title>
<!-- include Bootstrap CSS for layout -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
@addyosmani
addyosmani / scratchpad.md
Last active Oct 25, 2017
Webpack Performance Presets
View scratchpad.md

"We need Webpack presets" and "Webpack and its plugins are too hard to configure correctly" have been the number one cause of developer pain shared with me from large sites adopting Progressive Web Apps and optimising their load performance.

If I was building a Webpack preset pack for performance, I might use the following:

  • Ensure you're using a production build of your framework: new webpack.DefinePlugin({ 'process.env': env })
  • Minify your JS: webpack.optimize.UglifyJsPlugin
  • Compress your resources (GZip): compression-webpack-plugin
  • Split your vendor chunks: CommonsChunkPlugin
@thsutton
thsutton / normalise-path.php
Created Jan 10, 2011
Normalise paths in PHP
View normalise-path.php
<?php
/**
* Normalise a file path string so that it can be checked safely.
*
* Attempt to avoid invalid encoding bugs by transcoding the path. Then
* remove any unnecessary path components including '.', '..' and ''.
*
* @param $path string
* The path to normalise.
* @param $encoding string
You can’t perform that action at this time.