Skip to content

Instantly share code, notes, and snippets.

View ar-android's full-sized avatar
:octocat:
NULL

Ahmad Rosid ar-android

:octocat:
NULL
View GitHub Profile
var Scraper = require('./scraper.js');
var scraper = new Scraper({
baseUrl: 'https://medium.com'
});
scraper.scrape('/@ocittwo', function(err, $) {
if (err) {
console.log(err);
return;
@ar-android
ar-android / scraper.js
Created September 18, 2017 09:40
Set class for scraping using cheerio and request
var cheerio = require('cheerio');
var extend = require('extend');
var request = require('request');
module.exports = function(userOptions) {
var options = extend({
method: 'GET',
baseUrl: '',
gzip: true,
forever: true,
@ar-android
ar-android / ProfileActivity.java
Created September 15, 2017 07:46
Set rounded image view using glide.
imageView = (ImageView) findViewById(R.id.imageView);
Glide.with(this)
.asBitmap()
.load("https://avatars0.githubusercontent.com/u/11156973?v=4&s=100")
.into(new RoundedImageVIewTarget(imageView));
@ar-android
ar-android / RoundedImageVIewTarget.java
Created September 15, 2017 07:44
RoundedImageVIewTarget glide
import android.graphics.Bitmap;
import android.support.annotation.Nullable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import android.widget.ImageView;
import com.bumptech.glide.request.target.ImageViewTarget;
/**
@ar-android
ar-android / Reset AndroidStudio mac.txt
Created August 31, 2017 16:06
Reset AndroidStudio mac
rm -rfv ~/Library/Application\ Support/AndroidStudio*
rm -rfv ~/Library/Preferences/AndroidStudio*
rm -rfv ~/Library/Caches/AndroidStudio*
rm -rfv ~/Library/Logs/AndroidStudio*
rm -rfv ~/.AndroidStudio*
import React, {Component} from 'react'
import {
View,
StyleSheet,
Dimensions,
ListView,
Image, Text
} from 'react-native'
import React from 'react'
import {
View,
Text,
AsyncStorage,
ListView,
Image,
StyleSheet,
Dimensions, ActivityIndicator
} from 'react-native'
import ApolloClient, { createBatchingNetworkInterface } from 'apollo-client';
const networkInterface = createBatchingNetworkInterface({
uri: 'Url hosted',
batchInterval: 10,
opts: {
// Options to pass along to `fetch`
}
});
@ar-android
ar-android / is_empty.js
Created August 22, 2017 05:16
Javascript check empty object in es6
const isEmpty = (value) => value === undefined || value === null || (typeof value === "object" && Object.keys(value).length === 0) || (typeof value === "string" && value.trim().length === 0)
<?php
return [
'prefix' => 'graphql',
'routes' => '{graphql_schema?}',
'controllers' => \Folklore\GraphQL\GraphQLController::class.'@query',
'variables_input_name' => 'variables',
'middleware' => [],
'headers' => [],