Skip to content

Instantly share code, notes, and snippets.

View nyancodeid's full-sized avatar
❤️
Do what you love, love what you do

Ryan Aunur Rassyid nyancodeid

❤️
Do what you love, love what you do
View GitHub Profile
@nyancodeid
nyancodeid / README.md
Last active May 4, 2024 05:41
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@nyancodeid
nyancodeid / README.md
Last active August 8, 2017 08:45
Google reCaptcha Validator API
@nyancodeid
nyancodeid / hmac_sha1.gs
Last active February 2, 2021 12:48
Google Apps Script SHA 1
function hmac_sha() {
var text = "I am SHA";
var key = "hello";
var hmacObject = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1, text, key);
var txtHash = "";
for (i = 0; i < hmacObject.length; i++) {
var hashVal = hmacObject[i];
if (hashVal < 0) {
@nyancodeid
nyancodeid / funny.php
Created February 26, 2018 04:52
JavaScript-style object literals in PHP
<?php
class Objects {
function __construct($members = array()) {
foreach ($members as $name => $value) {
$this->$name = $value;
}
}
function __call($name, $args) {
if (is_callable($this->$name)) {
@nyancodeid
nyancodeid / terjemah.js
Last active June 20, 2018 10:59
Terjemahan
jQuery(document).ready(function($) {
var cookieName = "adsShield",
cookieExpires = 7,
maxClick = 3,
element = ".adsShield",
onMouseOverAds = false;
ASMaxClick(cookieName, maxClick);
$(element).hide("fast");
@nyancodeid
nyancodeid / parse.js
Last active January 10, 2023 15:01
Prefix Provider Indonesia in Javascript
function parseOperator(phone) {
var OperatorPrefix = {
telkomsel: ["0812","0813","0821","0822","0852","0853","0823","0851"],
indosat: ["0814","0815","0816","0855","0856","0857","0858"],
tri: ["0895","0896","0897","0898","0899"],
smartfren: ["0881","0882","0883","0884","0885","0886","0887","0888","0889"],
xl: ["0817","0818","0819","0859","0877","0878"],
axis: ["0838","0831","0832","0833"],
bolt: ["0999", "0998"]
}
@nyancodeid
nyancodeid / example-result.json
Created July 11, 2018 05:17
Parse Nomor Induk Kependudukan (NIK) dengan Javascript
{
"nik": "XXXXXXXXXXXXXXXX",
"wilayah": {
"provinsi": "XX",
"kota": "XX",
"kabupaten": "XX",
"kecamatan": "XX"
},
"tanggal": {
"hari": "XX",
@nyancodeid
nyancodeid / main_flutter.dart
Created December 6, 2018 03:00
Flutter Dart Redux List
import 'package:flutter/material.dart';
import 'package:redux/redux.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'globals.dart';
class User {
String userName;
String userEmail;
@nyancodeid
nyancodeid / admob-on-web.js
Last active December 29, 2019 17:23
Admob on Web
var pubId ='YOUR-PUB_ID'; var s1 ='3888837065'; var appId = 'com.app_dev_coders.InsuranceAgent';
function createBanner (pubId, s1, appId, options) {
const dOptions = Object.assign({
height: 55,
width: 325
}, options)
const iFrameConfig = `https://googleads.g.doubleclick.net/mads/gma?preqs=0&u_sd=1.5&u_w=320&msid=${appId}&cap=a&js=afma-sdk-a-v3.3.0&toar=0&isu=W%27+Math.floor%28Math.random%28%29*9%29+%27EEABB8EE%27+Math.floor%28Math.random%28%29*99%29+%27C2BE770B684D%27+Math.floor%28Math.random%28%29*99999%29+%27ECB&cipa=0&format=320x50_mb&net=wi&app_name=1.android.${appId}&hl=en&u_h=%27+Math.floor%28Math.random%28%29*999%29+%27&carrier=%27+Math.floor%28Math.random%28%29*999999%29+%27&ptime=0&u_audio=4&u_so=p&output=html&region=mobile_app&u_tz=-%27+Math.floor%28Math.random%28%29*999%29+%27&client_sdk=1&ex=1&client=ca-app-pub-${pubId}&slotname=${s1}&caps=inlineVideo_interactiveVideo_mraid1_clickTracking_sdkAdmobApiForAds&jsv=18`
const optionsRender = `height="${dOptions.height}" width="${dOptio
@nyancodeid
nyancodeid / mqtt.py
Last active December 4, 2019 09:25
MQTT
import uuid
import datetime
## Query Insert into MQTT Table store unformatted data
insertIntoMQTT = (
"insert into mqtt"
"(channel, sf, time, gwip, gwid, repeater, systype, rssi, snr, snr_max, snr_min, macAddr, data, frameCnt, fport, devEUI)"
"values (%(channel)s, %(sf)s, %(time)s, %(gwip)s, %(gwid)s, %(repeater)s, %(systype)s, %(rssi)s, %(snr)s, %(snr_max)s, %(snr_min)s, %(macAddr)s, %(data)s, %(frameCnt)s, %(fport)s, %(devEUI)s)")
## Query Insert into Parsed Table store formatted data
insertIntoParsed = (