Skip to content

Instantly share code, notes, and snippets.

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 20, 2025 21:14
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ondrej-kvasnovsky
ondrej-kvasnovsky / create-index.json
Last active December 26, 2015 19:49
JDBC river from MySql to ElasticSearch
PUT /_river/jdbc_river_1/_meta
{
"type" : "jdbc",
"jdbc" : {
"url": "jdbc:mysql://localhost:3306/yourDb",
"user": "login",
"password": "pass",
"sql" : "SELECT * FROM Transactions WHERE user_id = 1",
"index" : "my_jdbc_index",
"type" : "my_jdbc_type",
<?php
use lithium\core\Libraries;
Libraries::applyFilter('instance', function($self, $params, $chain) {
$data = $chain->next($self, $params, $chain);
if (isset($params['options']['model'])) {
$data->applyFilter('save', function() {
// ....
@beije
beije / 10.0.0.10.conf
Last active February 26, 2021 18:58
An example apache virtual host config for internal proxying. A wonderous hack if you lack control of DNS servers and need to test a site on a device that doesn't let you modify the hosts file.
<VirtualHost *:80>
ServerName 10.0.0.10
# Set url to proxy
ProxyPass / http://hosts.domain.dev/
ProxyPassReverse / http://hosts.domain.dev/
# Set location
<location />
# Set url
<?php
namespace app\extensions\action;
/**
* Observer for the Observer pattern. When a subject sends a notification for an event,
* the registered listeners can act upon it.
*
* @author hdonner
*
@mdsahib
mdsahib / tree.php
Created November 11, 2012 23:13
Generating category tree as HTML unordered list
<?php
//error_reporting (0);
$arr = array
(
0=> array
(
'id' => 1,
'parent' => 0,
'status' => 2,
'slug' => 'clothes',
@agborkowski
agborkowski / g11n.php
Created October 12, 2012 17:32
Lithiumphp::g11n::tld
/**
* @author AgBorkowski <[email protected]>
* @link http://blog.aeonmedia.eu
*/
/**
* Locales
*
* Adds globalization specific settings to the environment. The settings for
* the current locale, time zone and currency are kept as environment settings.
@caseman
caseman / gist:3428752
Created August 22, 2012 19:49
Ctor: Lightweight Javascript Constructors with Inheritance

Ctor: Lightweight Javascript Constructors with Inheritance

Author: Casey Duncan @iamnotcasey

This Javascript constructor with inheritance pattern is designed as a lightweight alternative to other methods I've seen while still providing a nice abstraction as a 13 line function that can be easily inlined into your code.

@notomato
notomato / gist:3376901
Created August 17, 2012 08:10
Example configuring multiple cache types
<?php
//config/bootstrap/cache.php
use lithium\storage\Cache;
Cache::config(array(
'local' => array(
'adapter' => 'Apc'
),
@notomato
notomato / gist:3376894
Created August 17, 2012 08:06
Quick and dirty admin
<?php
// somewhere in config/bootstrap
Dispatcher::config(array('rules' => array(
'admin' => array(
'action' => 'admin_{:action}'
)
)));
// app/classes/PostsController.php