int a = 1;
+------------+
// OO Style | |
class A { | |
def f = lotOfStuff1(a) | |
def a = lotOfStuff2(b) | |
def b = lotOfStuff3(c) | |
def c(x: X) = { ... } | |
} | |
class A2 extends A { | |
override def c(x: X) = { something different here } |
/* | |
* SSO - Lab 6.1 | |
* Tymon Tobolski 181037 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
# config/initilizers/acts_as_api.rb | |
ActsAsApi::Config.include_root_in_json_collections = false |
stress λ pwd 18:35:34 | |
/Users/teamon/bin/gatling-charts-highcharts-1.3.0/user-files/simulations/org/scalajars/stress | |
stress λ cat ProjectSearchSimulation.scala 18:35:38 | |
package org.scalajars.stress | |
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import com.excilys.ebi.gatling.jdbc.Predef._ | |
import com.excilys.ebi.gatling.http.Headers.Names._ | |
import akka.util.duration._ | |
import bootstrap._ |
~ λ cat .zshrc | grep "function ip" --after 5 | |
function ip { | |
echo "External: $(curl --silent checkip.dyndns.org | awk '{print $6}' | cut -f 1 -d "<")" | |
echo "Ethernet: $(ifconfig en0 | grep netmask | awk '{print $2}')" | |
echo "Airport: $(ifconfig en1 | grep netmask | awk '{print $2}')" | |
echo "VPN: $(ifconfig ppp0 | grep inet | awk '{print $2}')" | |
} |
require 'clockwork' | |
require 'sidekiq' | |
# load all jobs from app/jobs directory | |
# no need to load rails env, we only care about classes | |
# (#perform method is not invoked in this process) | |
Dir["app/jobs/*"].each {|f| load f } | |
module Clockwork | |
every(1.day, 'midnight.job', :at => '00:00'){ |
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/ | |
O rly? Duplikacja atrybutów, duplikacja walidacji, pozdro z walidacja typu uniqueness of albo cokolwiek innego co hituje bazy per model. |
package recurly.api | |
import java.util.Date | |
import play.api.libs.ws._ | |
import play.api.libs.concurrent._ | |
import play.api.Logger | |
import com.ning.http.client.Realm.AuthScheme | |
class Api(val apiKey: String, val privateKey: String) { | |
val base = "https://api.recurly.com/v2" |
package recurly.api | |
import java.util.Date | |
case class Account( | |
accountCode: String, | |
username: String, | |
email: String, | |
firstName: String, | |
lastName: String, |