Skip to content

Instantly share code, notes, and snippets.

🚀
Developing ideas

Jabran Rafique⚡️ jabranr

🚀
Developing ideas
Block or report user

Report or block jabranr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jabranr
jabranr / basic-facebook-login-flow.js
Last active Aug 29, 2015
Basic Facebook login and data retrieval flow
View basic-facebook-login-flow.js
// Check and verify user status or prompt for authorization
function checkUserStatus(response) {
var permissions = {
scope: '' // email
};
if ( isConnectedUser(response) )
return FB.api('/me', gotUserInfo);
return FB.login(checkUserStatus, permissions);
}
@jabranr
jabranr / custom-callback-with-google-maps-loading-flow.js
Last active Aug 29, 2015
Custom callback with Google Maps loading flow
View custom-callback-with-google-maps-loading-flow.js
// setup
!(function(root) {
var AsyncGoogleMap = (function() {
// constructor
function AsyncGoogleMap(canvas, lat, lng, zoom, callback) {
if ( typeof canvas === 'undefined' )
@jabranr
jabranr / vanilla-javascript-bootstrap.js
Last active Dec 2, 2015
Vanilla JavaScript Bootstrap
View vanilla-javascript-bootstrap.js
/**
* This is small, light weight vanilla JavaScript Bootstrap script.
*
* It comes handy in situations where a framework i.e. jQuery is used only
* for "load" and "ready" events etc. This small script will not only save
* lot of bytes but also gives a basic start on writing object literal JavaScript.
*
* Learn more about object literal JavaScript at following resource:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals
*
View Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
sass: {
compile: {
options: {
style: 'compressed'
},
files: {
'styles/screen.css': 'styles/screen.scss'
@jabranr
jabranr / decimal2binary.php
Last active Feb 25, 2016
Converts the integer to binary and outputs list of integers that are power of 2 (http://jabran.me/using-special-integers-with-bitwise-operators-for-php-rbac/)
View decimal2binary.php
<?php
/**
* Converts the integer to binary and outputs list of integers that are power of 2
*
* @author: Jabran Rafique <hello@jabran.me>
* @param: integer $decimal
* @return: string
*/
function get_special_binary( $decimal ) {
@iaserrat
iaserrat / FBLogin.swift
Last active Apr 7, 2016
This is a swift port of the official FacebookSDK login tutorial. It's been tested on Xcode 6 Beta 1 with the iOS 8 Simulator. You can find the official FB tutorial here: https://developers.facebook.com/docs/facebook-login/ios/v2.0
View FBLogin.swift
// YourProject-Bridging-Header.h
#import <FacebookSDK/FacebookSDK.h>
// AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
.
@balupton
balupton / ajaxify-html4.js
Created Mar 7, 2011
Ajaxify a Website using the HTML4 HashChange Functionality
View ajaxify-html4.js
(function(window,undefined){
// Prepare our Variables
var
document = window.document,
$ = window.jQuery;
// Wait for Document
$(window).bind(function(){
// Prepare Variables
@jabranr
jabranr / Format Text String to Tweet with JavaScript String prototype.js
Last active May 14, 2017
Format Text String to Tweet with JavaScript String.prototype
View Format Text String to Tweet with JavaScript String prototype.js
// Enable IE8 support for indexOf
if ( typeof Array.prototype.indexOf === 'undefined' ) {
Array.prototype.indexOf = function(item) {
for (var i = 0; i < this.length; i++) {
if (this[i] === item) {
return i;
}
return -1;
}
}
@macalac
macalac / gist:d1c17c5edc4b6cb4e20e
Last active Jul 31, 2017 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
View gist:d1c17c5edc4b6cb4e20e

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
View mention-twitter.js
/*
*---------------------------------------------------------------
* Twitter
*---------------------------------------------------------------
*/
(function($, undefined){
"use strict";
var MentionApp = MentionApp || {};
You can’t perform that action at this time.