Skip to content

Instantly share code, notes, and snippets.

View fedir's full-sized avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
set :application, "appname"
set :repository, "git@github.com:username/project.git"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/apps/#{application}"
set :scm, :git
set :branch, "master"
set :typo3_local_folders, %W(fileadmin typo3temp uploads)
set :typo3_source, %W(index.php t3lib typo3)
namespace :deploy do
desc "Set up the expected application directory structure on all boxes"
task :setup, :except => { :no_release => true } do
sudo <<-CMD
mkdir -p #{deploy_to} #{releases_path} #{shared_path}
CMD
typo3_local_folders.each do |asset|
@tjlytle
tjlytle / imageColor.php
Created November 17, 2009 19:19
Class to find 'average' image color.
<?php
/**
* imageColor
*
* Shows three methods to find the 'average' image color.
*
* Each function expects a gd image object.
*
* imageColor::averageResize($image) resizing to 1px, and checking the color.
* imageColor::averageBorder($image) find the average color of all border pixels.
@colinmollenhour
colinmollenhour / makePhpstormMap.php
Last active October 6, 2023 13:26
Generate map of factory method arguments to resolved class names for Magento projects
<?php
/* This script generates a mapping of factory methods/parameters to the resulting class
* names in such a way that PhpStorm 6.0.1 can use for autocompletion and chaining.
*
* Example:
* cd [magento root]
* php ~/makePhpstormMap.php > .phpstorm.meta.php
*
*/
@fedir
fedir / newDb.sh
Last active April 21, 2017 16:20
New database and it's user creation
#!/bin/bash
mysql -e "CREATE DATABASE \`$1\` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql -e "GRANT ALL PRIVILEGES ON \`$1\`.* TO '$2'@'localhost' IDENTIFIED BY '$3' WITH GRANT OPTION;"
@danfrost
danfrost / customise.php
Created November 29, 2011 12:40
How to use TYPO3 hooks to customise what is displayed in a given listing.
# 1. Make an empty extension
# 2. ext_tables.php
<?php
require_once t3lib_extMgm::extPath('dblist_hook') . '/class.user_tx_belisthook.php';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] = 'user_tx_belisthook';
?>
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@dadoonet
dadoonet / fr.sh
Created March 21, 2012 10:27
French analyzer for ES
#!/bin/bash
ES='http://localhost:9200'
ESIDX='test3'
ESTYPE='test'
curl -XDELETE $ES/$ESIDX
curl -XPUT $ES/$ESIDX/ -d '{
"settings" : {
@GUI
GUI / install_vagrant_sudoers.sh
Created June 3, 2012 19:13 — forked from beddari/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports