Skip to content

Instantly share code, notes, and snippets.

View akrabat's full-sized avatar

Rob Allen akrabat

View GitHub Profile
@sgolemon
sgolemon / gist:0e1ea13a16d21098e73f
Last active August 29, 2015 14:23
Questionable use of GitHub APIs

Over-reacted to second hand info and misinterpreted docs.

I do think OAuth providers (like Github, Twitter, Facebook, etc...) should do more to discourage apps from requesting write access. It PARTICULARLY disturbs me that admin:public_key is even an option in Github's Scopes. So the potential for disasterous outcomes certainly exists when granting access to apps via Github's OAuth system, but provided that you carefully read what you're granting access to, it's not necessarily as bad a my original post (left intact below) made it out.


During a twitter conversation[1] this morning, I discovered that in order for an application to get something as simple as your name during a single-sign on, it has to ask for full user profile information. That's a bit scary by itself, but when asking for full profile information, it also has to ask for read and WRITE permissions.[2]

Yes, in order to use single-signon to a 3rd party site, I have to give that site the rights to modify my email addr

$constants = get_defined_constants();
array_walk(array_keys($constants), function($key) use (&$constants) {
if ('T_' != substr($key, 0, 2)) {
unset($constants[$key]);
}
});
var_export($constants);
@alper
alper / import-tweets.txt
Created April 18, 2012 16:25
Thinkup Tweet importetr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
// Generated on: 2012-04-13 23:44:46 GMT+00:00
// ************** Tweet 1 of 47455 **************
{
"in_reply_to_screen_name": null,
@Maks3w
Maks3w / ghgfk.html
Last active December 19, 2015 07:59
GitHub Git Flow Killer first stub
<!DOCTYPE html>
<html>
<head>
<title>Merge GitHub's PRs with Git Flow style</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
<link rel="stylesheet" href="css/bootstrap-responsive.min.css"/>
</head>
<body>
<div class="container">
@robmccormack
robmccormack / mrm_fav_hotkeys.md
Last active December 19, 2015 10:19
mrm_Favorite_Hotkeys - hotkeys and quick tips.
@phillipsharring
phillipsharring / MyCustomValidator.php
Last active December 22, 2015 11:49
Zend Framework 2 Form Attaching a custom validator to an element that allows nulls.
<?php
namespace Application\Validator;
use Zend\Validator\AbstractValidator;
class MyCustomValidator extends AbstractValidator
{
const CONDITIONAL_EMPTY = 'conditionally_empty';
const SOMETHING_BAD = 'something_bad';
[
{
"keys": ["enter"],
"command": "run_macro_file",
"args": {
"file": "res://Packages/Default/Add Line in Braces.sublime-macro"
},
"context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
let digs: Set<Character> = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
extension String {
var firstNum: Int? {
return self
.characters
.indexOf(digs.contains)
.map(characters.suffixFrom)
.flatMap { cs in
Int(String(cs.prefixUpTo(cs.indexOf { c in !digs.contains(c) } ?? cs.endIndex)))

Development Contract Killer

A fork of the popular open-source contract for web designers and developers by Stuff & Nonsense, reworded for developers


Between us [company name] and you [customer name]

@listrophy
listrophy / Glob.swift
Created June 25, 2015 17:14
Wrap glob(3) in Swift
//
// Glob.swift
//
// Created by Brad Grzesiak on 6/25/15.
// Copyright © 2015 Bendyworks Inc.
// Released under the Apache v2 License.
//
import Foundation