Skip to content

Instantly share code, notes, and snippets.

@ikawka
ikawka / MY_Session.php
Created November 28, 2012 03:47 — forked from zhouming/MY_Session.php
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
@ikawka
ikawka / .gitignore
Created September 16, 2013 06:58 — forked from karmi/.gitignore
.DS_Store
*.log
tmp/
@ikawka
ikawka / config.inc.php
Created October 4, 2013 02:04 — forked from nodesocket/config.inc.php
phpMyAdmin Mod
<?php
$cfg['ShowPhpInfo'] = true;
$cfg['TitleTable'] = '@SERVER@ - @DATABASE@ - @TABLE@';
$cfg['TitleDatabase'] = '@SERVER@ - @DATABASE@';
$cfg['TitleServer'] = '@SERVER@';
$cfg['TitleDefault'] = '@SERVER@';
// 2 Hours Till Auto-Logout
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
@left-panel-width: 13em;
@right-panel-width: 13em;
.ui-panel {
width: @left-panel-width;
}
.ui-panel.ui-panel-position-right {
width: @right-panel-width;
}
@ikawka
ikawka / docker-cleanup-resources.md
Created November 10, 2017 03:26 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@ikawka
ikawka / htmlentity.js
Created September 20, 2018 04:20 — forked from CatTail/htmlentity.js
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
/*
* http://www.javascriptkit.com/dhtmltutors/sticky-hover-issue-solutions.shtml
* Method 3- Using CSS Media Queries Level 4 Interaction Media Features
*/
@media (hover:none),
(hover:on-demand) {
nav a:hover {
/* suppress hover effect on devices that don't support hover fully */
background: none;