Skip to content

Instantly share code, notes, and snippets.

View Dubiy's full-sized avatar
🔥
code everyday

Gary Dubiy

🔥
code everyday
View GitHub Profile

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@kikill95
kikill95 / Pass callbacks
Last active October 19, 2019 07:33
perform.js
//by Denys Pysmennyi
function perform() {
//TODO implement
}
perform(20, function(value) {
console.log(value) // 20
var param = 1;
console.log(param); // 1
<?php
$volumeId = 'vol-id';
$daysLimit = 3;
$ownerId = '0123456789101';
$tag = false; // tag name or false
$date = date('Y-m-d H:i:s');
@spitimage
spitimage / app.js
Created May 1, 2014 22:49
Using AngularJS events for global key bindings
angular.module('moduleName')
// Broadcasts key events down the scope chain
.run(function($document, $rootScope){
$document.bind('keypress', function(e) {
$rootScope.$broadcast('keypress', e);
});
})
// Here we have a controller as a keypress subscriber.
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

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.
@matshofman
matshofman / gist:4145718
Created November 25, 2012 22:41
RA Dec to Alt Az converter
using System;
namespace RaDecToAltAz
{
/// <summary>
/// Explenation of the calculations at http://www.stargazing.net/kepler/altaz.html
/// </summary>
class RaDecToAltAz
{
double RA = 250.425; // 16 h 41.7 m * 15