Skip to content

Instantly share code, notes, and snippets.

~
nlundsten $ cat /etc/nginx/conf.d/virtual.conf
server {
listen 80;
server_name .dev;
set $basepath "/home/nlundsten/workspace";
set $domain $host;
set $rootpath "Misc";
@nclundsten
nclundsten / decorate.sh
Last active November 7, 2017 00:52
hide/unhide (toggle) gnome shell 3 window decorations
#!/bin/bash
wininfo=$(xwininfo)
windowid=$(echo "$wininfo" | grep "Window id" | cut -b 22-31)
abstopleft=$(echo "$wininfo" | grep "Absolute upper-left X" | cut -b 27-31)
reltopleft=$(echo "$wininfo" | grep "Relative upper-left X" | cut -b 27-31)
if [ $abstopleft = $reltopleft ]; then
##restore window decorations
xprop -id $windowid -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x1, 0x0, 0x0"
sudo systemctl stop nginx.service
sudo systemctl stop php-fpm.service
sudo systemctl stop mysqld.service
sudo systemctl start nginx.service
sudo systemctl start php-fpm.service
sudo systemctl start mysqld.service
sudo chmod 777 /var/lib/php/session
sudo tail -f /var/log/nginx/error.log
//from module.php
public function onBootstrap($e)
{
$app = $e->getParam('application');
$sl = $app->getServiceManager();
$adapter = $sl->get('my_adapter_name');
[nlundsten@localhost ~]$ nslookup
> d2
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find d2: NXDOMAIN
> set d2
> set timeout=1
> pastebin.com
addlookup()
@nclundsten
nclundsten / gist:6057477
Created July 22, 2013 20:40
multi option builder + uoms -- index.php
<?php
$builders = array(
//red small
'1' => array(
'product_id' => 1,
'choices' => array('100', '300'),
'uoms' => array(
'ea_1' => array(
'uom_code' => 'EA',
'quantity' => '1',
$('form#search-search').submit(function(e){
$.post("/admin/catalogmanager/find", $(this).serializeArray(), function(result){
//trying to get result['html'] but its "undefined", but a console.log(result) shows a html: 'content'
})
});
[nlundsten@localhost zendframework]$ git diff 1b43cd688b 570778c77eb7fbc6a9c80 library/Zend/Paginator/Adapter/DbSelect.php
diff --git a/library/Zend/Paginator/Adapter/DbSelect.php b/library/Zend/Paginator/Adapter/DbSelect.php
index 92c7b53..c9ade72 100644
--- a/library/Zend/Paginator/Adapter/DbSelect.php
+++ b/library/Zend/Paginator/Adapter/DbSelect.php
@@ -103,22 +103,15 @@ class DbSelect implements AdapterInterface
}
$select = clone $this->select;
- $select->reset(Select::COLUMNS);
<?php
//speckcatalog product mapper
public function getByCategoryId($categoryId, $siteId=1)
{
$table = $this->getTableName();
$linker = 'catalog_category_product';
$joinString = $linker . '.product_id = ' . $table . '.product_id';
$where = array(
<?php
//speckcatalog product mapper
public function getByCategoryId($categoryId, $siteId=1)
{
$table = $this->getTableName();
$linker = 'catalog_category_product';
$joinString = $linker . '.product_id = ' . $table . '.product_id';
$where = array(
'category_id' => $categoryId,