Skip to content

Instantly share code, notes, and snippets.

View OzzyCzech's full-sized avatar
👋
Hi there...

Roman Ožana OzzyCzech

👋
Hi there...
View GitHub Profile
@RadekDvorak
RadekDvorak / Lock.php
Created July 19, 2011 13:19
Hack na FileJournal v Nette
<?php
/**
* Exclusive lock in memcache
*
* @author Radek Dvořák <radek.dvorak@profimedia.cz>
*/
class Lock
{
/**
@addyosmani
addyosmani / scratchpad.md
Last active October 25, 2017 15:34
Webpack Performance Presets

"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
@jaywilliams
jaywilliams / array_to_object.php
Created December 16, 2009 04:57
Convert a multi-dimensional array into a stdClass object. Pass by reference.
<?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);
*
@dnaber-de
dnaber-de / editor_plugin.js
Created January 22, 2012 18:33
Wordpress TinyMCE Popup-Dialog. German Tutorial on http://dnaber.de/p1477
// js/editor_plugin.js
/**
* an example tinyMCE Plugin
*/
tinymce.create(
'tinymce.plugins.myPlugin',
{
/**
* @param tinymce.Editor editor
* @param string url
@kareman
kareman / trash.swift
Last active April 14, 2020 13:40 — forked from beccadax/trash.swift
Swift 3 script for sending files and folders to the trash, using the SwiftShell framework from https://github.com/kareman/SwiftShell .
#!/usr/bin/env swiftshell
/*
* Released under the MIT License (MIT), http://opensource.org/licenses/MIT
*/
import SwiftShell
import Dispatch
import Cocoa
input[type="search"]::-webkit-search-cancel-button {
--size: 11px;
--background: #7F7F7F;
--icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3IiBoZWlnaHQ9IjciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci14Ij48cGF0aCBkPSJNMTggNkw2IDE4TTYgNmwxMiAxMiIvPjwvc3ZnPgo=");
-webkit-appearance: none;
height: var(--size);
width: var(--size);
border-radius: 50%;
background: var(--background) var(--icon) 50% 50% no-repeat;
}
@Marak
Marak / base64.js
Created February 8, 2011 00:41
An extremely simple implementation of base64 encoding / decoding using node.js Buffers
/*
* 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) {
@thsutton
thsutton / normalise-path.php
Created January 10, 2011 03:02
Normalise paths in 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
@sepehr
sepehr / get_daterange_timestamps.php
Created August 27, 2013 09:16
PHP: Get corresponding timestamp boundaries of a daterange
<?php
/**
* Generates timestamp bounderies for the passed date range name.
*
* @param string $range Date range name.
*
* @return array
*/
function get_daterange_timestamps($range)
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active April 27, 2023 15:44
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

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