Skip to content

Instantly share code, notes, and snippets.

View Jekis's full-sized avatar

Eugene Eroshkin Jekis

  • Russia, Novosibirsk
View GitHub Profile
@olivertappin
olivertappin / update-phpstorm.sh
Created July 20, 2017 07:58
Download and install the latest version of PhpStorm for Ubunti
#!/bin/bash
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
echo "Downloading the latest PhpStorm to /tmp"
cd /tmp
@sikofitt
sikofitt / composer.json
Last active July 2, 2021 19:51
Guzzle promise example and Pool example
{
"name": "sikofitt/guzzle-example",
"description": "Guzzle Example",
"type": "project",
"require": {
"php":">=5.6",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"symfony/var-dumper": "^3.2",
@ankurk91
ankurk91 / bash_profile.md
Last active October 22, 2023 12:16
:octocat: Git branch name in Linux/Mac Bash Terminal

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@carlcraig
carlcraig / parameters.rake
Last active January 18, 2016 09:52
Capistrano Symfony Parameters
desc "create empty parameters"
task :parameters_empty do
on roles(:all) do
if not test("[ -f #{shared_path}/app/config/parameters.yml ]")
upload! StringIO.new('---'), "#{shared_path}/app/config/parameters.yml"
end
end
end
desc "configure parameters with dist values if not defined"
@lmammino
lmammino / curlStreamedDownload.php
Created December 21, 2012 15:15
Download a large file (streaming) with php and curl extension
<?php
$url = 'http://www.example.com/a-large-file.zip';
$path = '/path/to/a-large-file.zip';
$fp = fopen($path, 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
@chrisk
chrisk / crontab.erb
Created August 17, 2011 20:34
Example crontab generation in Capistrano
# This crontab is automatically generated on deploy
SHELL=/bin/bash
[email protected]
RAILS_ENV=<%= stage %>
RAKE_CMD="<%= "#{bundle_path} rake --rakefile #{current_path}/Rakefile --trace" %>"
LOG_FILE="<%= "#{current_path}/log/cron.log" %>"
# Note: times are in the user's local time
<% if stage == :production && primary_server -%>