Skip to content

Instantly share code, notes, and snippets.

Working from home

Alex Coles myabc

Working from home
View GitHub Profile
henrypoydar / config.yml
Created Nov 20, 2017
Rails 5.1 CircleCI 2.0 Configuration
View config.yml
version: 2
working_directory: ~/circleci-myapp
- image: circleci/ruby:2.4.2-node-browsers
codeluggage / es6ToNightwatch.js
Last active May 8, 2018
Convert ES6 classes to basic Javascript objects to export for Nightwatch
View es6ToNightwatch.js
'use strict';
* The purpose of this function is to convert an ES6 class to either:
* 1) A test suite if it has "tests" as a property
* 2) A page object with optional "elements", "commands" and "url"
* @param es6Class The actual class object (not instance of the class) to convert
module.exports = function(es6Class) {
let properties = Object.getOwnPropertyNames(es6Class.prototype);
fran-worley / _form.html.erb
Last active Oct 23, 2017
A working example of nested forms just using Reform.
View _form.html.erb
<%= simple_form_for @form do |f| %>
<%= f.error_notification %>
<%= f.input :name %>
<%= f.input :email %>
<%= link_to_add_fields icon(:plus),
scy /
Last active Jul 3, 2021
My OSX PF config for #30C3.

My OS X “VPN only” Setup For #30C3

You should never let passwords or private data be transmitted over an untrusted network (your neighbor’s, the one at Starbucks or the company) anyway, but on a hacker congress like the #30C3, this rule is almost vital.

Hackers get bored easily, and when they’re bored, they’re starting to look for things to play with. And a network with several thousand connected users is certainly an interesting thing to play with. Some of them might start intercepting the data on the network or do other nasty things with the packets that they can get.

If these packets are encrypted, messing with them is much harder (but not impossible! – see the end of this article). So you want your packets to be always encrypted. And the best way to do that is by using a VPN.

Target audience

sj26 / assets.rake
Last active Dec 12, 2015
Don't discard cache during asset precompile. Full explanation and caveats:
View assets.rake
# Stick this in lib/tasks/assets.rake or similar
# A bug was introduced in rails in 7f1a666d causing the whole application cache
# to be cleared everytime a precompile is run, but it is not neccesary and just
# slows down precompiling.
# Secondary consequences are the clearing of the whole cache, which if using
# the default file cache could cause an application level performance hit.
# This is already fixed in sprockets-rails for rails 4, but we patch here for
View passwords_controller.rb
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
private :resource_params
seanlilmateus / gist:3187192
Last active Mar 5, 2021
How to use Obj-C with MacRuby/Rubymotion
View gist:3187192

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
kilaulena / gist:2561283
Created Apr 30, 2012
Drilling in your wall and not in cables
View gist:2561283
TIL when you drill in your wall (eg to hang up a shelf), these are ways to avoid drilling into a power
- I always thought this rule of thumb would suffice: do not drill within a straight vertical or
horizontal line from power sockets. TIL in Germany to be on the safe side, you need to add a 20cm safety
distance to each side of these lines. Within this distance can be supply lines too!
- Power supply line detectors are worthless when they are cheap, the pricier ones can help you a bit, but
they still are no guarantee: when the lines are deeper within the wall, they can not be detected exactly
at all.
View psych_yml_tester.rb
# ruby -e "$(curl -fsSL" <directory>
# for example:
# ruby -e "$(curl -fsSL" .
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler = 'psych'
directory = ARGV[0]