Skip to content

Instantly share code, notes, and snippets.

View jque's full-sized avatar
🏠
Working from home

Jorge Queiruga jque

🏠
Working from home
View GitHub Profile
@jque
jque / README.md
Created August 31, 2018 20:31 — forked from tamlyn/README.md
Execution order of Jest/Jasmine test code

Execution order of Jest/Jasmine test code

While tests run in source order, surrounding code does not which can lead to hard to debug issues.

Compare the test file below with the sample output below that and note the order of the log messages.

Key points

  • Any code not inside of it, beforeAll, afterAll, beforeEach or afterEach runs immediately on initialisation.
  • This means code at the end of your file runs before even your before hooks.
@jque
jque / gist:f73c26eb43046ce7a15965fd5e2b8b9d
Created October 11, 2016 17:10 — forked from silviorelli/gist:ad8e1d80bdc0245eb7e7
Install Ruby 1.8.7 on Mac OSX 10.11 El Capitan with rbenv
brew install apple-gcc42 openssl libyaml libffi
xcode-select --install
export CC=/usr/local/bin/gcc-4.2
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
rbenv install 1.8.7-p375
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:700|Droid+Serif' rel='stylesheet' type='text/css'>
<div id="banner">
<div id="bannertext">
<h1>PARAL &amp; LAX</h1>
<p>Finest webdesign since 1870</p>
</div>
</div>
<div id="content">
<!-- Physics shaders -->
<script id="physics-vert" type="x-vertex-shader">
attribute vec2 aVertexPosition;
void main() {
gl_Position = vec4( aVertexPosition, 1, 1 );
}
@jque
jque / api.js
Created May 20, 2013 21:02 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
Rails.application.config.to_prepare do
SubscriptionPlan.class_eval do
scope :active, where(:active => true)
scope :by_price, order(:amount)
end
end
@jque
jque / schema.rb
Created February 15, 2011 07:35 — forked from stympy/schema.rb
ActiveRecord::Schema.define(:version => 20100824224246) do
create_table "users", :force => true do |t|
t.string "name"
t.text "friend_list"
t.datetime "created_at"
t.datetime "updated_at"
end
end
framework 'Cocoa'
framework 'WebKit'
class Cat
attr_accessor :name, :age
def initialize(name = 'kitty', age=42)
@name = name
@age = age
end
#!/usr/bin/env ruby
# encoding: UTF-8
#
# LearnRubyByExample:
#
# Ruby is a highly expressive programming language.
# Testing software is an expressive way to communicate how it works.
#
# In the middle of a night awake for allergy and insomnia, and some days after the 1st _why day,
# I've tried to combine Ruby and testing to help teaching ruby with some goals in mind: