Skip to content

Instantly share code, notes, and snippets.

View hugueslamy's full-sized avatar
😎

Hugues Lamy hugueslamy

😎
  • Montreal, Quebec, Canada
View GitHub Profile
{"swagger":"2.0","info":{"version":"1.0.0","title":"Otonom Approbation system","description":"This API describe the information needed to interact with the approbation system of Otonom Solution","termsOfService":"https://www.otonomsolution.com/terms","contact":{"name":"OtonomSolution IT support","email":"[email protected]"}},"host":"localhost:3000","basePath":"/api/v1","schemes":["http","https"],"consumes":["application/json","text/plain"],"produces":["application/json","text/plain"],"paths":{"/organizations":{"get":{"summary":"All organization that you have access to","description":"Return all the organization name and basic information","operationId":"getAllOrganizations","produces":["application/json"],"tags":["Organizations"],"responses":{"200":{"description":"Organization response","schema":{"type":"array","items":{"$ref":"#/definitions/Organization"}},"examples":{"application/json":{"id":1,"name":"Test","created_at":"2020-09-30T21:48:36.133Z","updated_at":"2020-09-30T21:48:36.133Z","url":"http://loc
@hugueslamy
hugueslamy / session_controller.rb
Created July 2, 2016 17:25
Snippet of code to manually connect Devise without going to warden strategies.
def create
resource = User.find_for_database_authentication(email: params[:user][:email])
return invalid_login_attempt unless resource
if resource.valid_password?(params[:user][:password])
sign_in :user, resource
return render nothing: true
end
invalid_login_attempt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hugueslamy
hugueslamy / add_menu_attributes.patch
Last active December 25, 2015 00:49
This file add the attributes, weight and mlid to drupal menu_import. This is based on the version 1.5 of menu_import and this fix most likely will be useless on the next release as the options as been added to the current master branch. Do not use for other things than menu_import version 1.5 for Drupal 7.
From f53c22fb9c3862c0ec11040f079b2ab37ec85c61 Mon Sep 17 00:00:00 2001
From: Hugues Lamy <[email protected]>
Date: Wed, 9 Oct 2013 13:35:28 -0400
Subject: [PATCH] Add check to avoid including null attributes in menu_links
---
includes/import.inc | 39 ++++++++++++++++++++++++++++++---------
1 file changed, 30 insertions(+), 9 deletions(-)
diff --git a/includes/import.inc b/includes/import.inc
/**
* A* (A-Star) Pathfinding Algorithm in JavaScript
* @author Matthew Trost
* @license Creative Commons Attribution-ShareAlike 3.0 Unported License
* @datepublished December 2010
*/
function astar (map, heuristic, cutCorners) {
var listOpen = [];
var listClosed = [];
@hugueslamy
hugueslamy / jqueryinfirebug.js
Created March 6, 2012 22:34
Load JQuery from Firebug console
j=document.createElement("SCRIPT");
j.src="http://code.jquery.com/jquery-latest.pack.js";
document.getElementsByTagName("HEAD")[0].appendChild(j);
@hugueslamy
hugueslamy / gist:1073264
Created July 9, 2011 03:21
Cool Maptool Macro for inspiration
<!-- DIALOG BOX -->
[h:screen=input(
"tab0|Main||TAB",
"power|Power Name|Power",
"action|Standard,Move,Minor,Free,Immediate Interupt,Immediate Reaction,Opportunity,No Action|Action Type|LIST|SELECT=0 VALUE=STRING ",