Skip to content

Instantly share code, notes, and snippets.

View elchappo's full-sized avatar
👻

Pawel Zareba elchappo

👻
View GitHub Profile
@elchappo
elchappo / Mac OS X: Open in Visual Studio Code
Created December 1, 2017 00:33 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
version: '3'
services:
###############################
# Built from local Dockerfile #
###############################
web:
# Build the Dockerfile in this directory.
build: .
# Mount this directory as a volume at /app
volumes:
@elchappo
elchappo / dbal-nullable.php
Created May 2, 2016 17:56 — forked from chrisguitarguy/dbal-nullable.php
Just in case anyone was wondering how set allow a column to be nullable with Doctrine DBAL's Schema later.
<?php
use Doctrine\DBAL\Schema\Schema;
// assuming you're using composer...
$loader = require __DIR__ . '/vendor/autoload.php';
$schema = new Schema();
$users = $schema->createTable('users');
@elchappo
elchappo / 1) Install
Last active August 29, 2015 14:16 — forked from nghuuphuoc/1) Install
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/lib/docker/registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/usr/bin/jq
readonly repository_dir=$base_dir/repositories
@elchappo
elchappo / nginx
Created July 8, 2014 21:53 — forked from hisea/nginx
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@elchappo
elchappo / gist:6114482
Created July 30, 2013 16:23
BASH: Find unique images by file name
find . -name '*.png' -exec basename {} \; | sort | uniq -u | wc -l