Skip to content

Instantly share code, notes, and snippets.

View ZaneA's full-sized avatar

Zane Ashby ZaneA

View GitHub Profile
@leek
leek / _Magento1_DeleteTestData.md
Last active December 29, 2023 09:51
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.

@Tocacar
Tocacar / gist:4337861
Created December 19, 2012 16:06
I need to create a custom DataSourceIterator so that I can pass a related collection's properties to the sonata admin bundle's exportAction (I think this is the only way to achieve the export of one-to-many values, I may be wrong). I have traced backwards how my admin class is currently generating a DataSourceIterator (I think) - see below. Pres…
// vendor/sonata-project/admin-bundle/Sonata/AdminBundle/Admin/Admin.php
/**
* @return
*/
public function getDataSourceIterator()
{
$datagrid = $this->getDatagrid();
$datagrid->buildPager();
@rtyler
rtyler / pomodoro.rb
Last active September 14, 2022 20:00
Simple pomodoro CLI tool for Linux
#!/usr/bin/env ruby
require 'time'
module Pomodoro
INTERVAL = 25 # minutes
TOTAL_INTERVALS = 4
BREAK_TIME = 5 # minutes
def self.notify(title, body)
system("notify-send -a pomodoro -t 5000 -u critical -i appointment '#{title}' '#{body}'")
https://papertrailapp.com/systems/setup
# sudo sh
# cd /etc
# wget https://papertrailapp.com/tools/syslog.papertrail.crt
# yum install rsyslog-gnutls
@rrosiek
rrosiek / install_mysql.sh
Last active June 5, 2023 07:08
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
@gcpantazis
gcpantazis / deploy.sh
Created June 12, 2014 21:57
Drone setup for deploying every branch to Dokku
#!/bin/bash
if [ $DRONE_BRANCH ]; then
git fetch --unshallow
git remote remove dokku
git remote add dokku dokku@foo.dokkuhost.com:project-bar-$DRONE_BRANCH
git push dokku $DRONE_BRANCH:master
fi
@tegansnyder
tegansnyder / debugging reindex locks mysql commands.md
Created December 2, 2014 23:57
Useful Mysql Commands for Debugging Magento Reindex Locks

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

@Shchvova
Shchvova / CMakeLists.txt
Last active January 3, 2017 04:49
Simple Lua + C++ template
cmake_minimum_required(VERSION 2.8.4)
project(clue)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/")
include("lua.cmake")
set(SOURCE_FILES main.cpp)
add_executable(clue ${SOURCE_FILES})
@maxpowa
maxpowa / simple_disconnect.cpp
Last active August 8, 2022 22:30
simple_disconnect module for znc 1.6+
/*
* Copyright (C) 2004-2015 ZNC, see the NOTICE file for details.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@SpiritLevel
SpiritLevel / silverstripe-mode.el
Last active August 5, 2019 05:45
SilverStripe mode for Emacs
;; Taken from https://gist.github.com/mmichelli/1062600
;; replace html-mode with web-mode in line 4 to get more web-mode like behaviour
(define-derived-mode silverstripe-mode html-mode "Silverstripe"
(font-lock-add-keywords
nil
'(
("\\(<% \\| %>\\)" 1 font-lock-keyword-face)
("\\(\\(if\\|else\\|control\\|cacheblock\\|Level\\|end_[a-zA-Z1-9_\.]*\\|include\\)+\\)\\>" 1 font-lock-function-name-face)