Skip to content

Instantly share code, notes, and snippets.

View GWillmann's full-sized avatar

Grégoire Willmann GWillmann

View GitHub Profile
@GWillmann
GWillmann / .gitlab-ci.yml
Created May 2, 2018 04:46
Running your php/js tests with docker (for GitLab CI and others)
image: kinoba/docker-custom-php:latest
services:
- mysql:5.7
variables:
DOCKER_DRIVER: overlay2
APP_ENV: test
...
@GWillmann
GWillmann / .gitlab-ci.yml
Last active May 1, 2018 17:14
.gitlab-ci.yml file to run php and js tests on GitLab
image: kinoba/docker-custom-php:latest
services:
- mysql:5.7
variables:
DOCKER_DRIVER: overlay2
APP_ENV: test
...
@GWillmann
GWillmann / Dockerfile
Last active May 1, 2018 17:12
Dockerfile for a custom php docker image
FROM php:7.1
RUN apt-get update
# Install first dependencies
RUN apt-get install zlib1g-dev \
libpng-dev \
libxslt-dev \
git -yq
@GWillmann
GWillmann / UserControllerTest.php
Last active March 31, 2018 07:37
Test controller with a stubbed ParamConverter
<?php
// Bunch of use ...
class UserControllerTest extends WebTestCase
{
function setUp()
{
$this->client = static::createClient();
}
@GWillmann
GWillmann / file_to_byte_array.rb
Last active November 30, 2017 12:45
Paperclip file to encoded Base64 Byte array
require 'base64'
byte_array_file = Paperclip.io_adapters.for(attachment.file).read
Base64.encode64(byte_array_file)
Thanks to Jonathar (https://gist.github.com/jonathar/731c5c4c3273d26f5369#file-paperclip-byte-buffer)
@GWillmann
GWillmann / data.txt
Created October 11, 2017 14:08
[Negozen data]
## FR IBAN
FR1420041010050500013M02606
@GWillmann
GWillmann / exclude-filter-2
Created April 5, 2017 12:06
Crawler SPAM#2
responsive\-test|torrent\-to|magnet\-to|dogsrun|tkpass|free\-video|keywords\-monitoring|pr\-cy\.ru|fix\-website|checkpagerank|seo\-2\-0\.|platezhka|timer4web|share\-buttons|99seo
@GWillmann
GWillmann / exclude-filter-1
Created April 5, 2017 12:05
Crawler SPAM#1
(best|dollar|success|top1)\-seo|(videos|buttons)\-for|anticrawler|^scripted\.|\-gratis|semalt|forum69|7make|sharebutton|ranksonic|sitevaluation|dailyrank|vitaly|profit\.xyz|rankings\-|dbutton|\-crew|uptime(bot|check|\.com)
@GWillmann
GWillmann / CopyItunesPlaylistToFolder.scpt
Created January 22, 2017 19:57
Copy all songs from an iTunes playlist to a folder (e.g.: a usb disk)
tell application "iTunes"
-- Asks the user to select a playlist to copy
set itunesPlaylists to (get name of playlists)
set selectedPlaylist to {choose from list itunesPlaylists}
-- Get every track in the selected playlist
set itunesFiles to (every file track of playlist (item 1 of (item 1 of selectedPlaylist)))
-- Asks the user to select the destination folder (where the files will be copied)
set destinationPath to (choose folder with prompt "Destination folder :")
@GWillmann
GWillmann / fix android studio
Created May 6, 2015 19:28
Problem with JDK_HOME and android studio
When Android Studio refuses to start because it can't find the JDK_HOME:
@see : http://tools.android.com/tech-docs/configuration/osx-jdk
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/
open /Applications/Android\ Studio.app