Skip to content

Instantly share code, notes, and snippets.

Cody Caughlan ruckus

Block or report user

Report or block ruckus

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
View ES6-Functional-Examples
let people = [
{ name: 'Bob', age: 28, child: { name: 'Sally', age: 8, grade: 3 } },
{ name: 'Sara', age: 46, child: { name: 'Lois', age: 14, grade: 9 } },
{ name: 'Ann', age: 27, child: { name: 'George', age: 9, grade: 4 } },
{ name: 'Dave', age: 52, child: { name: 'Hale', age: 17, grade: 11 } },
];
const add1 = (x) => x + 1;
const toFieldApplyFunc = (field, fn) => {
return (obj) => {
View BaseDao.kt
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View 0001_sidekiq_upstart.config
files:
"/opt/elasticbeanstalk/support/conf/sidekiq.conf":
mode: "000755"
content: |
description "Elastic Beanstalk Sidekiq Upstart Manager"
start on runlevel [2345]
stop on runlevel [06]
# explained above
respawn
respawn limit 2 30
@Ashoat
Ashoat / text-height-measurer.js
Created May 11, 2017
React Native component for measuring text height
View text-height-measurer.js
// @flow
import type {
StyleObj,
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
import React from 'react';
import PropTypes from 'prop-types';
import { Text, View, StyleSheet } from 'react-native';
import invariant from 'invariant';
@printercu
printercu / rails-5.0-integration-tests-speedup.md
Last active Jan 29, 2017
Speed up Rails 5 integration tests
View rails-5.0-integration-tests-speedup.md

Speed up integration tests in Rails 5 app

Rails 5 recompiles templates on every request in test env. Fix will be released only in 5.0.2.

Add this lines to test helper to get the performance now (I've got x2 improvement):

class << ActionView::LookupContext::DetailsKey
  def clear
@sbarski
sbarski / index.js
Last active Aug 13, 2019
A Lambda function that creates and submits an Elastic Transcoder job after being invoked by an S3 bucket
View index.js
'use strict';
var AWS = require('aws-sdk');
var s3 = new AWS.S3({
apiVersion: '2012-09-25'
});
var eltr = new AWS.ElasticTranscoder({
apiVersion: '2012-09-25',
region: 'us-east-1'
});
@hiattp
hiattp / sidekiq.config
Last active Aug 28, 2019
Sidekiq Config for Elastic Beanstalk
View sidekiq.config
# Sidekiq interaction and startup script
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
content: |
#!/bin/bash
. /opt/elasticbeanstalk/hooks/common.sh
. /opt/elasticbeanstalk/support/envvars
@henrik
henrik / config--initializers--rails4_to_rails3_downgradability.rb
Created Jun 18, 2015
Fix "NoMethodError: undefined method `sweep'" error when downgrading from Rails 4 to Rails 3.
View config--initializers--rails4_to_rails3_downgradability.rb
# Without this fix, downgrading from Rails 4 to Rails 3 causes session cookies to blow up.
#
# The way the flash is stored in the session changed in a backwards-incompatible way.
if Rails::VERSION::MAJOR == 3
module ActionDispatch
class Flash
def call(env)
if (session = env['rack.session']) && (flash = session['flash'])
@larrybolt
larrybolt / bootstrap-server.sh
Created Aug 23, 2014
Bootstrap server to use with ansible
View bootstrap-server.sh
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "please supply a servername: bootstrap-server.sh node.example.com"
exit 1
fi
username=`whoami`
# copy public rsa key to server for root user
read -r -p "Transfer ssh public keys to server for root? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
View EventBus.java
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
/**
* Simple pass-thru event bus with error handling and reconnect.
*/
public class EventBus {
You can’t perform that action at this time.