Skip to content

Instantly share code, notes, and snippets.

View kubido's full-sized avatar

Rifki Fauzi kubido

View GitHub Profile
@kubido
kubido / rollup.config.js
Last active January 16, 2022 18:51
Svelte rollup config for custom html template with hashed bundle filename
import svelte from "rollup-plugin-svelte";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import livereload from "rollup-plugin-livereload";
import { terser } from "rollup-plugin-terser";
import html from "@rollup/plugin-html";
const production = !process.env.ROLLUP_WATCH;
const version = String(
@kubido
kubido / script.js
Created September 24, 2021 09:52
SparkAR random text generator
/**
* (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
*/
//==============================================================================
// Welcome to scripting in Spark AR Studio! Helpful links:
//
// Scripting Basics - https://fb.me/spark-scripting-basics
// Reactive Programming - https://fb.me/spark-reactive-programming
// Scripting Object Reference - https://fb.me/spark-scripting-reference
@kubido
kubido / application.js
Created October 31, 2011 08:49
add client validation for search form if it's input is null
$('form[action*="search"]').live('submit', function(event) {
event.preventDefault();
arr_input = $('form').serializeArray();
arr_input.shift();
keywords_count = 0;
$.map(arr_input, function(el){
if(el.value != ""){keywords_count = keywords_count + 1}
});
if(keywords_count <= 0){
if($('.error.empty-search').length < 1){
@kubido
kubido / halodoc_all_hospitals.rb
Created August 24, 2021 12:06
halodoc hospitals scrapper
require('Faraday')
require('json')
def fetch_hospitals(page=1)
url = "https://www.halodoc.com/api/rumah-sakit/v1/hospitals/search"
params = { page_no: page, per_page: 20 }.to_json
headers = { "Content-Type": "application/json"}
response = Faraday.put(url, params, headers)
return JSON.parse(response.body)
module.exports = {
apps: [
{
name: 'entertainme - Client',
script: 'cd client && yarn install && yarn start',
},
{
name: 'entertainme - Orchestrator',
script: 'cd server/orchestrator/graphql && npm install && nodemon app.js',
},
@kubido
kubido / application.js
Last active June 3, 2020 03:20
Rails entry point for react webpacker application.js packs
import React from 'react'
import ReactDOM from 'react-dom'
const App = () => {
return(
<h1> Hello from React Webpacker </h1>
)
}
document.addEventListener('DOMContentLoaded', () => {
@kubido
kubido / tmux.md
Created March 6, 2017 14:39 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@kubido
kubido / automate daily office workflow
Last active December 18, 2015 20:49
sometime using foreman in my local machine causing a terminal session reset... so I need to add more tab in terminal window.. and it's pain, I need to add tab.. type the command... wasting time.. so I use this automator script. :)
tell application "iTerm"
activate
-- buat window baru
set myterm to (make new terminal)
tell myterm
-- perintah2 yang akan di eksekusi tiap di setiap tab
set thelistOfCommands to {"cleopatra && rsd", "satutempat_api && rsd1", "mongoserver", "redis-server", "fake_start"}
@kubido
kubido / gist:2946744
Created June 18, 2012 03:54
test arrow key
$(document).keydown(function(e){
speed = 3
switch (e.keyCode) {
case 37: // Move Left
$('.dialog').offset({left: $('.dialog').offset().left - speed});
break;
case 39: // Move Right
$('.dialog').offset({left: $('.dialog').offset().left + speed});
break;
@kubido
kubido / load_jquery
Created November 2, 2011 02:25
load jquery from chrome console, firebug.. etc
script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
document.body.appendChild(script);