Skip to content

Instantly share code, notes, and snippets.

@weshouman
weshouman / RESTful Facebook graph calls with curl.md
Last active September 15, 2016 05:37
Curl into the graph api

Acquiring an Access Token

First we need an access token with some permissions sufficient for the calls we are gonna make.
Let's just use the basic permissions about us.
To acquire an access token use this tool

GET reqeust

Following command should return {"name":user_name,"id":user_id}

curl -X GET "https://graph.facebook.com/me?access_token=ACCESS_TOKEN"
@weshouman
weshouman / Javascript promise notes.md
Last active October 28, 2017 06:37
Working with promises in Javascript #javascript

Create a Promise

We may create a promise by making it's promiseReturningFunction or whatever we may call it.

function SomeSortOfService($q, Provider) {
  var service = this;
  service.promiseReturningFunction = function(){
    // promise itself
    var deferred = $q.defer();
@weshouman
weshouman / fb_login_call.md
Created September 15, 2016 12:36
facebook login experience

Some notes about the provided example in Facebook Javascript SDK in the login documentation

FB.login(function(response) {
    // Here the authResponse is available for us to be used.
    // inside it we can debug the access token, it's expiration, granted permissions etc. : in example
    // reference for the FB.login fromat: https://developers.facebook.com/docs/facebook-login/web
    console.log('Granted scopes are: ' + response.authResponse.grantedScopes);
    console.log('Access token is' + response.authResponse.accessToken);
    if (response.authResponse) {
@weshouman
weshouman / Objects creation.md
Last active October 28, 2017 06:37
Javascript objects notes #javascript

Different Syntax for objects creation

First Way

AKA: Using object constructor.
By letting values/keys get decided later in the code

var data = {};
data.first_name = 'Ahmed';
data.last_name = 'Adel';
data.email = '[email protected]';
@weshouman
weshouman / git_commit_techniques.md
Last active September 22, 2016 17:56
Git techniques

Setup

Alias git commit to git ci
Alias git status to git st
Alias git diff --cached to git dc

git config --global alias.ci commit
git config --global alias.st status
git config --global alias.dc "diff --cached"
@weshouman
weshouman / setup steps and hints.md
Last active October 4, 2016 16:10
Social login notes

Various links that are associated with the social login for different providers, ie: Facebook and Google

Facebook

Mote: Facebook authentication is based on the access_token that gets changed from time to time.
keeping the access_token secured and using only the token provided the application itself is the application's task.

@weshouman
weshouman / Software study wishlist.md
Created October 2, 2016 08:11
software with interesting contents, structures or technologies

This list contains projects that I wish to discover, software reading.
In each software I'll add a couple of questions that answering them shall give more insights about how this software is created.
Wasabi may be useful for documenting those software structure.

Xournal

Project page

  • Language
  • UI Toolkit (cross platform)
  • Tablet XInput [How random lines are stored]
@weshouman
weshouman / front_end.md
Last active February 6, 2017 09:06
study materials for front end

Caution

This Gist is a WIP

The Big Story

How it feels to learn Javascript in 2016
If you didn't understand something/anything ... at least you know what's coming in your next Google search

While reading I wished I could differentiate between Bower, net registery, CDN and Browserify ... no luck yet. But here follows what I came up too.

@weshouman
weshouman / bash tips.md
Last active September 29, 2023 10:43
bash tips and tricks

Execute but Keep the Current Working Directory

following code changes cwd to ./step1

cd step_1
./build.sh
./test.sh

adding braces gets the code executed w/o affecting the cwd

(cd step_1 && ./build.sh && ./test.sh)
@weshouman
weshouman / NLP Guide.md
Last active October 7, 2016 06:38
a personal guide for NLP stuff

Note: Keonkim has a brilliant guide for almost every language and tool.
Note: A [search][2] by most stars for nlp on github gives a lot of repos too.

What comes next will be some highlighted stuff, which personally came of interest for me.


Are you a web/frontend person, check this JS nlp_compromise library.