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

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
@fedir
fedir / array_column.php
Last active December 19, 2015 15:18 — forked from TorbenKoehn/array_column.php
Prosthesis for PHP < 5.5 to implement array_column
<?php
if(!function_exists('array_column')) {
function array_column(array $input,$column_key,$index_key=null) {
$r=array();
foreach($input as $k=>$v)
$r[$index_key?$v[$index_key]:$k]=$v[$column_key];
return $r;
}
};
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@fedir
fedir / firewall.sh
Created June 10, 2013 09:48 — forked from nicolargo/firewall.sh
Firewall startup script // via @nicolargo
#!/bin/sh
#
# Simple Firewall configuration.
#
# Author: Nicolargo
#
# chkconfig: 2345 9 91
# description: Activates/Deactivates the firewall at boot time
#
### BEGIN INIT INFO
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|
set :application, "App Name" # Your app name
set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository
set :document_root, "/home/user/www/awesome_app"
set :deploy_via, :remote_cache
# SSH Settings
set :user, "user_ssh"
set :password, "password_ssh"
set :use_sudo, false
@fedir
fedir / kill.js
Created June 3, 2013 16:50 — forked from davidbgk/kill.js
/**
* Casper script to restart Alwaysdata processes.
*
* Usage:
* $ casperjs kill.js email@example.com mysecretpassword
*/
var casper = require('casper').create();
casper.start("https://admin.alwaysdata.com/login/");
@fedir
fedir / gist-backup.py
Last active April 21, 2024 21:31 — forked from nicerobot/backup.sh
Clone or update all user's gists #backup #github #gists #management
#!/usr/bin/env python
# Clone or update all a user's gists
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python
# USER=fedir python gist-backup.py
import json
import urllib
from subprocess import call
from urllib import urlopen
import os
@fedir
fedir / google-font-dl.py
Last active January 30, 2024 05:20 — forked from kevinoid/google-font-dl.py
Script to download google fonts locally (for web development off-line, for example). Use : python getAllGoogleFonts.py Dosis
#!/usr/bin/env python
#
# Downloader for Google Web Fonts
#
# For usage information run with "--help"
#
# Works on Python 2.6 and later, 3 and later
# Requires tinycss (and argparse for Python 2.6) from pip
#
# Permission is hereby granted, free of charge, to any person obtaining a copy