Skip to content

Instantly share code, notes, and snippets.

View Jolg42's full-sized avatar
👋
Hello! Nice to see you here!

Joël Galeran Jolg42

👋
Hello! Nice to see you here!
View GitHub Profile
@Jolg42
Jolg42 / extractSbixImages.py
Created March 14, 2017 15:34
Extract sbix strikes from font
#!/usr/bin/env python
from fontTools.ttLib import TTFont
from os.path import exists, join
from os import mkdir, sys
# print 'Number of arguments:', len(sys.argv), 'arguments.'
# print 'Argument List:', str(sys.argv)
# print sys.argv[1]
def main():
@Jolg42
Jolg42 / unicodeGlyphNamesMapping.js
Created November 12, 2016 18:39
Javascript Object for Mapping Glyph Unicodes Names
// Key is Decimal
// From https://github.com/adobe-type-tools/agl-aglfn
// Converted with http://www.convertcsv.com/csv-to-json.htm template "{parseInt(f1, 16)}: "{f2}" "
var unicodeNamesBasicPlane = {
65: "A",
198: "AE",
508: "AEacute",
193: "Aacute",
258: "Abreve",
194: "Acircumflex",
@Jolg42
Jolg42 / app.js
Created October 31, 2016 09:41
FastSpring Remote Server Request MD5 Signature Check
var express = require('express');
var router = express.Router();
var _ = require('lodash');
var crypto = require('crypto');
var secret = 'MY_SECRET_PRIVATE_KEY';
router.post('/', function (req, res) {
// Check User Agent
@Jolg42
Jolg42 / generate-basic-latin-font-node.js
Created June 27, 2016 12:32
Generate font with Basic Latin complete charcater set
// This example shows how to create a font from scratch using node.js.
'use strict';
var opentype = require('../src/opentype');
// These are the global measurements of the typeface.
var UNITS_PER_EM = 1000;
var ASCENDER = 800;
var DESCENDER = -200;

Keybase proof

I hereby claim:

  • I am jolg42 on github.
  • I am jolg42 (https://keybase.io/jolg42) on keybase.
  • I have a public key whose fingerprint is BA48 B941 7374 7706 DBAD F04A 7113 1B1D A111 EC20

To claim this, I am signing this object:

#!/bin/bash
export PATH=... # might not be needed, but sometimes the PATH is not set
# correctly in cron-called scripts. Copy the PATH setting you
# normally see under console.
cd YOUR_DIRECTORY # the directory where the script and imgs directory is located
{
echo "========================"

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.