Skip to content

Instantly share code, notes, and snippets.

View surfer190's full-sized avatar
🌆

surfer190 surfer190

🌆
  • South Africa
View GitHub Profile
@umidjons
umidjons / bootstrap-cmenu-yii.php
Created February 24, 2014 08:22
Use bootstrap menu in Yii with CMenu
<nav class="navbar navbar-default top-navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex-collapse">
<span class="sr-only">Expand the menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse navbar-ex-collapse">
@pstuifzand
pstuifzand / Model_Observer.php
Created March 8, 2015 13:04
Use Magento (Zend_Mail) with Mailcatcher
<?php
class Test_Test_Model_Observer {
public function _construct() {}
public function fixEmailConfig($observer) {
if (Mage::getStoreConfigFlag('dev/email/enabled')) {
$ip = $_SERVER["REMOTE_ADDR"];
$config = array('port' => '1025');
n98-magerun.phar config:dump | xmlstarlet sel -t -m '/config/global/events/*/observers/*' -v ./class -o ' ' -v ./method -o ' ' -v ./type -n
@toast38coza
toast38coza / docker-compose-postgres.yml
Last active January 6, 2018 21:44
Docker-compose files for Kong
version: "2"
services:
postgres:
image: postgres:9.4
container_name: kong-database
ports:
- "5432:5432"
environment:
- POSTGRES_USER=kong
@maderlock
maderlock / C3\Utility\DuplicateDatabase.php
Created September 2, 2016 11:03
PHP class to duplicate database
<?php
namespace C3\Utility;
use Monolog\Logger;
/**
* Class DuplicateDatabase
*
* @package C3\Utility
@mukundthanki
mukundthanki / My Magento Code.php
Last active May 31, 2018 09:24 — forked from claudiu-marginean/My Magento Code.php
Magento: Code Snippets
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@davetrux
davetrux / SQLiteDebugADB
Created March 24, 2014 14:42
Verbose Logging of SQLite statements in Android
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
adb shell start
@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@alces
alces / ansible_ad_hoc_inventories.md
Last active September 2, 2022 07:17
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

@tegansnyder
tegansnyder / opcache.ini
Last active September 2, 2022 16:24
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.