Skip to content

Instantly share code, notes, and snippets.

View jguitar's full-sized avatar

Juan F. Pérez jguitar

  • Barkibu
  • Valencia, Spain
View GitHub Profile
@tabirkeland
tabirkeland / environment.interface.ts
Last active July 26, 2019 04:33
Ionic 3.9.2 Environment Variables
export interface Environment {
DEBUG : boolean;
API_URL : string;
WS_URL : string;
BASE_URL : string;
}
#!/usr/bin/env ruby
require 'json'
exec 'rspec --format json --out rspec_results.json' unless File.exists? 'rspec_results.json'
results = JSON.parse(File.read 'rspec_results.json')
total_runtime = results['summary']['duration']
total_examples = results['examples']
@esaborit4code
esaborit4code / db_change_on_the_fly
Last active August 29, 2015 14:11
DB server change on the fly
mysqldump -h origin.server.com -u the_origin_user -p the_origin_database --ignore-table=the_origin_database.that_huge_table | tee dump.sql | mysql the_database -u the_user --password=ThePassword
mysqldump -h origin.server.com -u the_origin_user -p the_origin_database that_huge_table --no-data | mysql the_database -u the_user --password=ThePassword
mysqldump -h origin.server.com -u the_origin_user -p the_origin_database that_huge_table | mysql the_database -u the_user --password=ThePassword
@esaborit4code
esaborit4code / bookmarks
Created June 30, 2014 15:56
JS bookmarks
jQueryfy: loads jQuery in pages that don't have it
javascript: (function()%7Bvar el%3Ddocument.createElement(%27div%27),b%3Ddocument.getElementsByTagName(%27body%27)%5B0%5D%3Botherlib%3Dfalse,msg%3D%27%27%3Bel.style.position%3D%27fixed%27%3Bel.style.height%3D%2732px%27%3Bel.style.width%3D%27220px%27%3Bel.style.marginLeft%3D%27-110px%27%3Bel.style.top%3D%270%27%3Bel.style.left%3D%2750%25%27%3Bel.style.padding%3D%275px 10px%27%3Bel.style.zIndex%3D1001%3Bel.style.fontSize%3D%2712px%27%3Bel.style.color%3D%27%23222%27%3Bel.style.backgroundColor%3D%27%23f99%27%3Bif(typeof jQuery!%3D%27undefined%27)%7Bmsg%3D%27This page already using jQuery v%27%2BjQuery.fn.jquery%3Breturn showMsg()%3B%7Delse if(typeof %24%3D%3D%27function%27)%7Botherlib%3Dtrue%3B%7D function getScript(url,success)%7Bvar script%3Ddocument.createElement(%27script%27)%3Bscript.src%3Durl%3Bvar head%3Ddocument.getElementsByTagName(%27head%27)%5B0%5D,done%3Dfalse%3Bscript.onload%3Dscript.onreadystatechange%3Dfunction()%7Bif(!done%26%26(!this.readyState%7
@jaimeiniesta
jaimeiniesta / rails_jobs.txt
Last active November 15, 2018 09:15
Resources to find a job as a Rails developer
The following is a list of places where you can find job offers as a Rails developer:
https://twitter.com/currofile
https://twitter.com/domestikaempleo #spain only
http://www.workingwithrails.com/
https://weworkremotely.com/jobs/search?term=rails
https://jobs.github.com/
http://trabajosrails.com/ # spain only
http://www.indeed.com/q-Ruby-On-Rails-Developer-jobs.html
@albertohm
albertohm / README.md
Created November 4, 2013 22:41 — forked from ayosec/README.md

Xvnc

The scripts in this gist will start an Xvnc server with a basic window manager (IceWM). This is intended to use in a virtual machine, where we can need to start a browser to run a test suite.

Installation on Debian

All commands have to be run as root

apt-get install icewm vnc4server
@scruti
scruti / ScopesAndLambdas.md
Last active December 25, 2015 04:19
Wrapping RoR scopes with lambdas and updating lambdas to new syntax. Done with Sublime Text find & replace.

Moving from lambda { |param| ... } to ->(param) { ... }

  • Find What: lambda\s*\{\s*\|(\w+,*\s*\w+)\|
  • Replace With: ->($1) {

Wrapping scopes with lambdas

  • Find What: scope\s:(\w+),\s(\w+.+)
  • Replace With: scope :$1, -> { $2 }
@webdevotion
webdevotion / self-signed-localhost-for-rails.txt
Last active March 21, 2019 16:02 — forked from trcarden/gist:3295935
SSL self signed localhost for rails start to finish, no red warnings.
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@jacegu
jacegu / gist:6091719
Last active August 3, 2021 03:20
Differences between Domain Services & Application Services

The differences between a domain service and an application services are subtle but critical:

  • Domain services are very granular where as application services are a facade purposed with providing an API.
  • Domain services contain domain logic that can’t naturally be placed in an entity or value object whereas application services orchestrate the execution of domain logic and don’t themselves implement any domain logic.
  • Domain service methods can have other domain elements as operands and return values whereas application services operate upon trivial operands such as identity values and primitive data structures.
  • Application services declare dependencies on infrastructural services required to execute domain logic.
  • Command handlers are a flavor of application services which focus on handling a single command typically in a CQRS architecture.

Source: http://gorodinski.com/blog/2012/04/14/services-in-domain-driven-design-ddd/