Skip to content

Instantly share code, notes, and snippets.

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

Arryangga Aliev Pratamaputra arryanggaputra

🏠
Working from home
View GitHub Profile
@arryanggaputra
arryanggaputra / fixed-width-numbers.css
Created February 14, 2021 06:07 — forked from wKovacs64/fixed-width-numbers.css
Fixed width numbers CSS
/* https://twitter.com/wesbos/status/932644812582522880/ */
font-feature-settings: "tnum";
font-variant-numeric: tabular-nums;
@arryanggaputra
arryanggaputra / leasePlan.js
Created November 26, 2019 01:32
get leasePlan words
getLeasePlanWords(100)
// 1,Lease,3,Lease,Plan,Lease,7,Lease,9,LeasePlan,11,Lease,13,Lease,Plan,Lease,17,Lease,19,LeasePlan,21,Lease,23,Lease,Plan,Lease,27,Lease,29,LeasePlan,31,Lease,33,Lease,Plan,Lease,37,Lease,39,LeasePlan,41,Lease,43,Lease,Plan,Lease,47,Lease,49,LeasePlan,51,Lease,53,Lease,Plan,Lease,57,Lease,59,LeasePlan,61,Lease,63,Lease,Plan,Lease,67,Lease,69,LeasePlan,71,Lease,73,Lease,Plan,Lease,77,Lease,79,LeasePlan,81,Lease,83,Lease,Plan,Lease,87,Lease,89,LeasePlan,91,Lease,93,Lease,Plan,Lease,97,Lease,99,LeasePlan
function getLeasePlanWords(range) {
if (range < 1 || range > 100) {
throw 'Range only 1-100'
}
words = ''
for (let index = 1; index <= range; index++) {
let isModulus = false
if (index % 2 == 0) {
import React, { Component } from 'react';
import {
View,
Text,
ScrollView,
Image,
ActivityIndicator,
RefreshControl,
Platform,
Alert,
@arryanggaputra
arryanggaputra / RCCTabBarController.m
Last active December 1, 2017 07:45
Customize icon color for each tab on react-native-navigation by WIX
#import "RCCTabBarController.h"
#import "RCCViewController.h"
#import <React/RCTConvert.h>
#import "RCCManager.h"
#import "RCTHelpers.h"
#import <React/RCTUIManager.h>
#import "UIViewController+Rotation.h"
@interface RCTUIManager ()
@arryanggaputra
arryanggaputra / FirstImage.php
Last active September 3, 2015 09:34
Get first image, if there's no image give the default Image URL
<?php
preg_match_all('~<img ([^>]+)>~i', $yourLongArticle, $matches);
$images = [];
foreach ($matches[1] as $str) {
preg_match_all('~([a-z]([a-z0-9]*)?)=("|\')(.*?)("|\')~is', $str, $pairs);
$images[] = array_combine($pairs[1], $pairs[4]);
}
if (!empty($images[0])) {
return $images[0]['src'];
}