Skip to content

Instantly share code, notes, and snippets.

View Jolg42's full-sized avatar
Taking a break 🏕️

Joël Galeran Jolg42

Taking a break 🏕️
View GitHub Profile

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.
#!/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 "========================"

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:

@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;
@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 / 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 / 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 / 00_logdna.config
Created December 4, 2018 11:11
00_logdna.config
files:
"/home/ec2-user/logdna.sh" :
mode: "000777"
owner: root
group: root
content: |
#!/bin/sh
rpm --import https://repo.logdna.com/logdna.gpg
echo "[logdna]
name=LogDNA packages
@Jolg42
Jolg42 / readme.md
Created January 25, 2020 14:13
Code Signing on macOS and Windows + Apple Notarization

macOS

Steps

  • What we want is to get a Developer Id https://developer.apple.com/developer-id/ to be able to sign the binaries for distribution.
  • The company needs to get an Apple Developer Account Membership for macOS for $99/y https://developer.apple.com/programs/enroll/
  • Apple needs a A D-U-N-S® Number to register the account, the person doing the registration will need to get in touch with somebody that knows the legal part.
  • The registration could take a couple days
  • When done, a certificate can be created for signing, you'll need to sync it with Xcode.
  • Now the binary can be signed, and the signature can be verified.
@Jolg42
Jolg42 / index.js
Last active February 3, 2021 08:52
Cloudflare CORS Proxy to NPM Registry
// From https://developers.cloudflare.com/workers/examples/cors-header-proxy
// We support the GET, POST, HEAD, and OPTIONS methods from any origin,
// and allow any header on requests. These headers must be present
// on all responses to all CORS preflight requests. In practice, this means
// all responses to OPTIONS requests.
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,OPTIONS",
"Access-Control-Max-Age": "86400",
}