Skip to content

Instantly share code, notes, and snippets.

Alex Coles myabc

Block or report user

Report or block myabc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@henrypoydar
henrypoydar / config.yml
Created Nov 20, 2017
Rails 5.1 CircleCI 2.0 Configuration
View config.yml
version: 2
jobs:
build:
environment:
working_directory: ~/circleci-myapp
docker:
- image: circleci/ruby:2.4.2-node-browsers
environment:
CC_TEST_REPORTER_ID: XXXYYY
RAILS_ENV: test
@codeluggage
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
fran-worley / _form.html.erb
Last active Oct 23, 2017
A working example of nested forms just using Reform.
View _form.html.erb
#views/users/_form.html.erb
<%= simple_form_for @form do |f| %>
<%= f.error_notification %>
<%= f.input :name %>
<%= f.input :email %>
<h4>
<%= link_to_add_fields icon(:plus),
@scy
scy / README.md
Last active Oct 19, 2019
My OSX PF config for #30C3.
View README.md

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
sj26 / assets.rake
Last active Dec 12, 2015
Don't discard cache during asset precompile. Full explanation and caveats: http://sj26.com/2013/02/09/the-asset-pipeline-isnt-actually-slow
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)
end
private :resource_params
end
@seanlilmateus
seanlilmateus / gist:3187192
Last active Sep 2, 2016
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
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
supply:
- 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
# USAGE:
# ruby -e "$(curl -fsSL https://raw.github.com/gist/1011972/2e6ac978bc06905f60e380b5fe5abbf898b3af0a)" <directory>
# for example:
# ruby -e "$(curl -fsSL https://raw.github.com/gist/1011972/2e6ac978bc06905f60e380b5fe5abbf898b3af0a)" .
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler = 'psych'
directory = ARGV[0]
You can’t perform that action at this time.