This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is sample script that let user input some values interactively | |
# also it caches theses values in .vagrant/app_data.json so after restart | |
# user will not need to enter again same values | |
# | |
# To use this class you need to use DataLoader.instance.ask everywhere where you needed to have dynamic data. | |
# | |
# Syntax: DataLoader.instance.ask(VARIABLE_NAME_TO_SAVE, PROMPT_MESSAGE, DATA_TYPE) | |
# VARIABLE_NAME_TO_SAVE - dictionary key name where to save value | |
# PROMPT_MESSAGE - prompt message that will be displayed before input | |
# DATA_TYPE - :password or :text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is simple PHP script that shows how to use composer directly from your PHP code | |
* | |
* First thing what you need is to include composer/composer in your composer.json | |
* and than you can use such code. | |
*/ | |
use Composer\Console\Application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM You need to install wget for windows first! | |
REM This command will download box (maybe there are also other win98 premade boxes for Vagrant? | |
REM This box doesn't work good with DirectX 3D and no SSH support (that's why vagrant displayes errors on lauch but works) | |
wget https://www.dropbox.com/s/btyp146041rravr/win98.box?dl=1 -O windows98.box | |
REM You need before vagrant with VirtualBox installed on you system | |
REM Adding box to vagrant | |
vagrant box add win98 windows98.box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
######################################################################################## | |
# This script will create multiple versions files from video for your video tag | |
# and also generates this tag. | |
# | |
# FFMPEG is needed. Most simple way to install it: choco install ffmpeg && refreshenv | |
# | |
# This small script uses public domain license so you can do whatever you want. | |
######################################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change these variables values | |
set @old_db='a'; | |
set @new_db='b'; | |
SET SESSION group_concat_max_len = 1000000; | |
# Don't change anything below | |
SELECT CONCAT('RENAME TABLE ' , GROUP_CONCAT(cmd SEPARATOR ', ')) 'sql' | |
FROM ( | |
SELECT CONCAT('`',@old_db,'`.`', TABLE_NAME, '` TO `',@new_db,'`.`', TABLE_NAME, '`') cmd | |
FROM information_schema.tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script should work however sftp is not supported in compiled curl so not everything fine here | |
# | |
# $_CI* vars should be defined in project variables | |
image: mwienk/docker-git-ftp | |
before_script: | |
- eval `ssh-agent -s` | |
- cat > deploy.key <(echo "$CI_SERVER_KEY") | |
- chmod 0600 deploy.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
chown -R www-data:www-data /vagrant/www | |
if grep -Fxq "~/.composer/vendor/bin" /etc/environment | |
then | |
echo ';)' | |
else | |
sed -i '/^PATH=/d' /etc/environment | |
PATH="$PATH:~/.composer/vendor/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xlog() { | |
$args = func_get_args(); | |
$line = $args[0]; | |
unset($args[0]); | |
$args = array_values($args); | |
if (empty($args)) { | |
echo $line; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM ***** BASIC ***** | |
Function ReplaceString(SearchWhat As String, ReplaceWith AS String, Content as string) as string | |
len1 = LEN(SearchWhat) | |
len2 = LEN(Content) | |
pos = InStr(Content, SearchWhat) | |
ret = Content | |
if pos <> 0 then | |
pos = pos -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ---------------------------------------- | |
# If You want migrate one repo from Assembla SVN to multiple GitHub repos | |
# (different repo - different svn folder) this script can help You :) | |
# | |
# What You need to make this script workable: | |
# * Change variables below | |
# * Install svn2git from https://github.com/nirvdrum/svn2git | |
# * Make sure your git works with ssh keys |