Skip to content

Instantly share code, notes, and snippets.

View SeptiyanAndika's full-sized avatar
🏠
Working from home

Septiyan Andika SeptiyanAndika

🏠
Working from home
View GitHub Profile
var express = require('express');
var router = express.Router();
var passport = require('passport');
var FacebookStrategy = require('passport-facebook').Strategy;
var AWS = require('aws-sdk');
var colors = require('colors');
var AWS_ACCOUNT_ID = 'XXXXXXXXXXX';
@SeptiyanAndika
SeptiyanAndika / authorize.js
Created June 1, 2017 09:31 — forked from kndt84/authorize.js
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@SeptiyanAndika
SeptiyanAndika / LocalBroadcastExampleActivity.java
Created March 5, 2017 17:09 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@SeptiyanAndika
SeptiyanAndika / README.md
Created February 14, 2017 03:45 — forked from boopathi/README.md
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@SeptiyanAndika
SeptiyanAndika / readme.md
Created January 12, 2017 18:39 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@SeptiyanAndika
SeptiyanAndika / merge.js
Created December 21, 2016 09:25 — forked from icebob/merge.js
Merge GraphQL schemas & resolvers in modules
let moduleQueries = [];
let moduleTypeDefinitions = [];
let moduleMutations = [];
let moduleResolvers = [];
let files = config.getGlobbedFiles(path.join(__dirname, "**", "*schema.js"));
// Load schema files
files.forEach((file) => {
let moduleSchema = require(path.resolve(file));
@SeptiyanAndika
SeptiyanAndika / Readme.md
Created November 24, 2016 15:08 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@SeptiyanAndika
SeptiyanAndika / CustomItemClickListener.java
Created September 8, 2016 04:44 — forked from riyazMuhammad/CustomItemClickListener.java
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@SeptiyanAndika
SeptiyanAndika / A-HopperBus-CodeSample-Readme.md
Created May 30, 2016 15:15 — forked from TosinAF/A-HopperBus-CodeSample-Readme.md
Example use of the Model-View-ViewModel Pattern in iOS (Swift) as explained in http://www.objc.io/issue-13/mvvm.html. Full Source Code can be found at https://github.com/TosinAF/HopperBus-iOS

I decided to build an iOS app for my University's bus service that runs through the various campuses.

xy

It was an interesting challenge as I had nothing but the printed timetables (http://www.nottingham.ac.uk/about/documents/903-times.pdf) to use as the data.

Thus I had to come with a suitable data structure that would complement the design & user experience i had in mind for the app.

I also decided to take the challenge of writing the app in swift. This project has helped me get to up speed with swift really quickly.