Skip to content

Instantly share code, notes, and snippets.

function sortByAttribute(gameList, sortAttributesList) {
if (!gameList) return; //Ensure we data data to sort
if (!sortAttributesList) return gameList; //Return same list if no sort attribute provided
sortAttributesList = typeof sortAttributesList === 'string' ? [sortAttributesList].slice() : sortAttributesList;
sortAttributesParams = getSortAttributesWithOrder(sortAttributesList);
return gameList.slice().sort(function (a, b) {
return sortByAttrStrategy(a, b, sortAttributesParams.slice());
});
var Promise = require('bluebird');
var _ = require('lodash');
//var User = app.models.User;
var ERRORS = {
userNotFoundError: {
code: 401,
success: false,
message: 'no user found with that id'
},
@aitoraznar
aitoraznar / add_intellij_launcher
Last active November 23, 2017 07:35
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=172.4343.14
Type=Application
Terminal=false
Icon[en_US]=/home/aitor/app/idea-IU-172.4343.14/bin/idea.png
Name[en_US]=IntelliJ
@aitoraznar
aitoraznar / enable_push_capability_base.rb
Created January 11, 2018 08:26
Enable IOS Push notificacion script
#!/usr/bin/env ruby
require 'xcodeproj'
name = "app_name" // <-Replace with your app name
projectpath = "platforms/ios/" + name + ".xcodeproj"
puts "Adding entitlement push to " + name
puts "Opening " + projectpath
proj = Xcodeproj::Project.open(projectpath)
entitlement_path = name + "/" + name + ".entitlements"

Description

  • Please include a summary of the change and which issue is fixed (Jira reference)
  • Please also include relevant motivation and context.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

@aitoraznar
aitoraznar / gist:2ba568696ad7f95049d7e40d4c56e072
Created January 22, 2020 11:35
Highlight HTML elements with CSS snippet
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
@aitoraznar
aitoraznar / web-servers.md
Created January 27, 2020 20:54 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000