Skip to content

Instantly share code, notes, and snippets.

View wearethefoos's full-sized avatar

Wouter de Vos wearethefoos

View GitHub Profile
@wearethefoos
wearethefoos / light-festival.ino
Last active November 5, 2022 19:10
Light Festival Demo Code
const byte rgb_8_r = 13;
const byte rgb_8_b = 15;
const byte rgb_8_g = 2;
const byte rgb_7_r = 0;
const byte rgb_7_b = 4;
const byte rgb_7_g = 16;
const byte rgb_6_r = 17;
const byte rgb_6_b = 5;
const byte rgb_6_g = 18;
const byte rgb_5_r = 23;
#!/usr/bin/env ruby
require 'net/http'
require 'json'
class Search
TOPICS = ["Day 1 - Frontend", "Day 2 - Basic Programming", "Day 3 - Loops & Breaks", "Day 4 - OOP", "Day 5 - Intro to Web with Sinatra & Git", "Day 6 - Intro to Ruby on Rails", "Day 7 - Hackathon I", "Day 08 - Rails, Deployment, Pull requests, Code review", "Day 09 - ActiveRecord", "Day 10 - Rails Testing with RSpec", "Day 11 - Users with Devise & Authorization with CanCan(Can)", "Day 12 - File uploads with Carrierwave", "Day 13 - Javascript 1", "Day 14 - SQL and Relations", "Day 15 - Javascript 2 & JQuery", "Day 16 - AJAX & REST", "Day 17 - Integration testing", "Day 18", "Day 19", "Day 20", "Day 21", "Day 22", "Day 23 - Javascript 3", "Day 24 - React 1", "Day 25 - React 2", "Day 26 - React 3", "Day 27 - Testing with Enzyme", "Day 28. FeathersJS", "Advanced Session :: Introduction to d3", "Advanced Session :: Introduction to Docker", "Advanced Session :: Redux", "Advanced Session :: Styling with Sass", "Codaisseur Cloud", "Git & Github",
@wearethefoos
wearethefoos / rewrite-host-lambda.js
Created April 15, 2019 11:32
Lambda function to force a specific Host header to be sent to the origin
'use strict';
// force a specific Host header to be sent to the origin
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
request.headers.host[0].value = 'jobs.mycompany.com';
return callback(null, request);
};
@wearethefoos
wearethefoos / syntax.md
Created November 4, 2016 11:24
Ruby vs JS vs ES6

Variables

Ruby

Name a value.

color = "red"
#!/usr/bin/env bash
#
# Rails console script that can be run on AWS Elastic Beanstalk.
#
# Run this script from the app dir (/var/app/current) as root (sudo script/aws-console)
#
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
@wearethefoos
wearethefoos / varnish3.rb
Created February 23, 2012 10:48 — forked from hmsk/varnish3.rb
Install Varnish-3.0.2 on OSX with homebrew
require 'formula'
class Varnish3 <Formula
url 'http://repo.varnish-cache.org/source/varnish-3.0.2.tar.gz'
homepage 'http://www.varnish-cache.org/'
md5 'c8eae0aabbe66b6daabdf3a1f58cd47a'
depends_on 'pkg-config' => :build
depends_on 'pcre' => :build
# Description
# Translate erb (html) into a slim version
#
# Commands
# learnbot erb2slim <your code here>
#
# Authors:
# Aeshta and Rosiene
module.exports = (robot) ->
require 'rails_helper'
describe BingeSerie do
it { should validate_presence_of :title}
it { should validate_presence_of :description}
it { should validate_presence_of :image}
it { should have_many :binge_episodes}
describe "#seasons" do
let(:series) { create(:binge_serie) }
import SocketClient from 'socket.io-client';
import Feathers from 'feathers-client';
import Utils from '../lib/Utils';
const API_HOST = "http://localhost:3030";
class BaseModel {
defaults() { return {}; }
constructor(resource_name, host = API_HOST) {
class Utils {
uuid() {
var i, random;
var uuid = '';
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i === 8 || i === 12 || i === 16 || i === 20) {
uuid += '-';
}