Skip to content

Instantly share code, notes, and snippets.

Sulaeman feelinc

Block or report user

Report or block feelinc

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
@feelinc
feelinc / RNPaypalWrapperModule.java
Created Jun 17, 2017
React Native Paypal Android SDK Wrapper module java file
View RNPaypalWrapperModule.java
package com.namasaya.RNPaypalWrapper;
import android.app.Activity;
import android.content.Intent;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
@feelinc
feelinc / Sulaeman\PaypalWebService\Plugin\Paypal\Model\Express.php
Created Jun 16, 2017
Process the Paypal express payment information from external app in Magento 2
View Sulaeman\PaypalWebService\Plugin\Paypal\Model\Express.php
<?php
/**
* This file is part of the Sulaeman Paypal Web Service package.
*
* @author Sulaeman <me@sulaeman.com>
*/
namespace Sulaeman\PaypalWebService\Plugin\Paypal\Model;
use Magento\Framework\Registry;
use Magento\Framework\Model\Context;
@feelinc
feelinc / CorsHeader.php
Created Sep 14, 2016
CORS Middleware for Laravel
View CorsHeader.php
<?php
namespace App\Http\Middleware;
use Closure;
class CorsHeader
{
/**
* Handle an incoming request.
@feelinc
feelinc / Translator.php
Created Sep 17, 2015
Translation class similar to Gettext usage approach
View Translator.php
<?php
use Symfony\Component\Translation\Translator as SymfonyTranslator;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Loader\PhpFileLoader;
class Translator
{
/**
@feelinc
feelinc / UploadDirS3.py
Last active Sep 4, 2019
Upload folder contents to AWS S3
View UploadDirS3.py
#!/usr/bin/python
import os
import sys
import boto3
# get an access token, local (from) directory, and S3 (to) directory
# from the command-line
local_directory, bucket, destination = sys.argv[1:4]
@feelinc
feelinc / UploadDirDropbox.py
Created Jun 30, 2015
Upload folder content to Dropbox
View UploadDirDropbox.py
#!/usr/bin/python
import os
import sys
from dropbox.client import DropboxClient
# get an access token, local (from) directory, and Dropbox (to) directory
# from the command-line
access_token, local_directory, dropbox_destination = sys.argv[1:4]
@feelinc
feelinc / aname-async.js
Last active Aug 29, 2015
REST API Resource Template Data
View aname-async.js
/**
* Module dependencies.
*/
var async = require('async')
, countryTemplate = require('./country')
, _ = require('underscore');
function aname(models, model, options, callback) {
if ( ! _.isObject(model)) {
if (typeof callback != 'undefined') {
View SomeClass.php
<?php
class SomeClass
{
/**
* Hold options data for later use.
*
* @var Array
*/
View Controller.php
<?php
return Response::json(new SettingTemplate($data));
View basic_auth_nodejs_test.js
var http = require('http');
var server = http.createServer(function(req, res) {
// console.log(req); // debug dump the request
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object)
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64
console.log("Authorization Header is: ", auth);
You can’t perform that action at this time.