Skip to content

Instantly share code, notes, and snippets.

View gerrywastaken's full-sized avatar
🔎
🔬 🕺 🔒 🌎 👾

Gerry gerrywastaken

🔎
🔬 🕺 🔒 🌎 👾
View GitHub Profile
@mohsen1
mohsen1 / download.js
Last active March 30, 2019 05:13
Download Chromecast backgrounds
var https = require('https');
var fs = require('fs');
var url = 'https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/backgrounds.json';
Array.prototype.getLast = function() {
return this[this.length - 1];
};
function logFail(err){
console.log('Failed!');
@JeffreyWay
JeffreyWay / laravel4.md
Created November 19, 2012 16:37
Laravel 4 Thoughts/Questions/Etc.

Laravel 4 Thoughts/Questions/Etc.

This is just a random list of notes, as I dig into Laravel 4. If you have any feedback/solutions, please leave a comment. I'll be compiling everything for an article on Nettuts+, when the framework is officially in Beta. This will be updated over the course of the week.

  • Running composer dump-autoload after every new controller is a pain. Can this not be automated through artisan controller:make ControllerName?

  • Seems that some of the View HTML helpers are missing. No HTML::script().

  • Route::resource('tasks', 'TasksController') doesn't seem to create named routes. This is a big deal, if not. What's the solution?

@nateware
nateware / gist:3997958
Created November 2, 2012 00:53
Cheat sheet to create auto-scaling group behind ELB
  1. Create the appropriate VPC that your application is going to live in. Create subnets for each availability zone you want to use.

  2. Create VPC security group(s) for your auto-scaling instances. For example, if you're going to auto-scale web servers, create a "web" VPC security group.

  3. Go into AWS console and create an ELB. Easy wizard. Select HTTP and (if needed) HTTPS. Make sure it's associated with the VPC you created in step 1.

  4. Create an auto-scaling launch configuration from the CLI. The launch configuration has the AMI, size, and security group from step #2. The security group must be by ID not name ("sg-12345"):

       as-create-launch-config web --image-id ami-2e31bf1e --instance-type m1.medium \
    

-g sg-7619041a --key root

@latentflip
latentflip / Instrumentor.coffee
Created October 27, 2012 12:21
Instrumentor
#depends on underscore
_.isConstructor = (thing) ->
if thing.name && thing.name[0].toUpperCase() == thing.name[0]
true
else
false
class Instrumentor
constructor: (namespace) ->
@mipearson
mipearson / cookie_helper.rb
Last active July 26, 2018 04:06
Persist a paypal developer sandbox login over multiple cucumber & capybara & selenium runs.

I've written this code to test what happens once a Stripe card token has been passed through to the server. This code does not do any browser testing (because JS-friendly headless testing is painful at best, and impossible if you want VCR in the mix). VCR is being used here to capture interactions with a test Stripe account, to ensure the tests are fast on future runs. That said, it's structured so that nothing is expected to be present in the Stripe account. If you delete all the stored VCR cassettes, the specs will safely re-record them.

Instead of using VCR.use_cassette directly, instead you use stripe_cassette in your specs, passing in the current spec example object. This will automatically generate a cassette name based on the spec's file name and the example's description (limitations of this are noted in the code comments). Within the cassette's recording block, Stripe data is cleared out before yielding back to the spec, with a context object. The context object provides access to helper methods

Index: sapi/cli/config.w32
===================================================================
--- sapi/cli/config.w32 (revision 308839)
+++ sapi/cli/config.w32 (working copy)
@@ -6,7 +6,8 @@
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
@msroot
msroot / gist:e95504d9f960b7243b7a
Created August 12, 2014 04:28
Collection Proxy
require "delegate"
class CollectionProxy
def products
@products ||= HasManyAssociation.new([])
@products.associated_class ||= Product
@products
end
end