Skip to content

Instantly share code, notes, and snippets.

View yonisetiawan's full-sized avatar

YONI SETIAWAN yonisetiawan

View GitHub Profile
@mars
mars / reactjs-filepicker.js
Last active March 8, 2018 05:09
Use Filepicker.io with React.js (v0.14, ES2015, & JSX)
/*
Filepicker lib must be loaded from script tag in HTML:
<script type="text/javascript" src="//api.filepicker.io/v2/filepicker.js"></script>
*/
class FilepickerInput extends React.Component {
componentDidMount() {
const filepickerElement = this.refs.filepicker;
if (typeof filepicker !== 'undefined') {
// Single-page app integration: https://developers.filepicker.com/docs/support/integration/117
@yuwen41200
yuwen41200 / .zshrc
Last active August 7, 2023 12:57
Custom .zshrc File
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/ywpu/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
@knowbody
knowbody / CameraApp.js
Last active December 28, 2020 06:23
Example CameraApp component, allows to take a photo and upload it to Amazon S3 bucket - blog post (https://medium.com/@knowbody/react-native-image-upload-to-s3-bucket-5220941bfea2#.9l2o8nmyf)
import React, { Component } from 'react';
import { AppRegistry, CameraRoll, Dimensions, View, StyleSheet } from 'react-native';
import Camera from 'react-native-camera';
import { Button } from 'react-native-vector-icons/Ionicons';
import { RNS3 } from 'react-native-aws3';
class CameraApp extends Component {
constructor() {
super();
@kevinold
kevinold / gist:368387f8da42ce7d24179f3a14359051
Created September 27, 2016 17:26 — forked from negativo/gist:152716565e4091eb9039f55f9781badd
send sms with aws provider in NODEJS
var AWS = require('aws-sdk');
AWS.config.region = 'your aws region';
AWS.config.update({
accessKeyId: "your access id",
secretAccessKey: "your secret access key",
});
var sns = new AWS.SNS();
var params = {
@fabrinal
fabrinal / offline.md
Created October 22, 2016 07:42
Contoh kode untuk ngoding offline

Petunjuk untuk cara mudah ngoding offline

  1. Copy paste kode di bawah
  2. Save menggunakan text editor (notepad,notepad++,sublime dll) dengan "namanya_terserah.html"
  3. Buka file namanya_terserah.html menggunakan browser.
  4. Lalu klik kanan di browser -> pilih inspect/Inspect Element -> pilih Console.
  5. Perhatikan hasil outputnya.
@hapr05
hapr05 / grabreceiptpromousage.gs
Last active January 9, 2018 14:59
Grab promo usage report script
//inspired by https://gist.github.com/oshliaer/70e04a67f1f5fd96a708
var SHEET_ID = 'YOUR_SHEET_ID';
var CREDIT_LIMIT = 500000; //YOUR GRAB LIMIT
var WARNING_THRESHOLD = 50000; //Will send warning email if credit balance is less than this threshold
var email = Session.getEffectiveUser().getEmail();
// auto detect current period
var curDate = new Date();
// if date > cutoff date (25) after_date's month is current month, else previous month