Skip to content

Instantly share code, notes, and snippets.

@okaprinarjaya
okaprinarjaya / stages-watch-driven-development.ts
Created December 10, 2023 12:23
Stages-Watch Driven Development - uuhhuuyy!
type Stage = {
name: string
description: string
status: string
};
class StagesWatcher {
private _stages: Stage[];
constructor() {
@okaprinarjaya
okaprinarjaya / traverse_dom.js
Last active January 24, 2022 14:55
Traverse DOM
const listings = document.querySelector("#\\39 9-root-app > div > div > div.sc-fodVxV.cYLuAZ > div > div.ui-container.flex.flex-justify-between.flex-align-start.relative > div.left-container-wrapper.flex.flex-row.flex-wrap.ui-row.flex-align-start.flex-justify-start > div");
// melihat semua child nodes
listings.childNodes;
// Listing number must start from index 2
// because listing is start from index 2
const LISTING_NUMBER = 2;
// melihat 1 node listing
threadsMock_Expected := []models.Thread{
{
ID: "123098ABCBCA",
Title: "Title in da house yeah",
Description: "Description description description",
IsActive: 0,
},
{
ID: "T001",
Title: "Thread title one",
/* eslint-disable no-console */
require('dotenv').config();
const radius = require('radius');
const dgram = require('dgram');
const RADIUS_SECRET = process.env.RADIUS_SECRET;
const client = dgram.createSocket('udp4');
const sent_packets = {};
function quicksort(list) {
if (list.length > 0) {
const pivot = list.splice(0, 1)[0];
const smaller = quicksort(list.filter(item => item < pivot) || []);
const bigger = quicksort(list.filter(item => item >= pivot) || []);
return smaller.concat([pivot]).concat(bigger);
} else {
return [];
}
.flight-search-date-picker-popup {
height: 100%;
background-color: #ffffff;
.date-picker-content-wrap {
height: 100%;
background-color: #ffffff;
}
}
@okaprinarjaya
okaprinarjaya / DatePickerPopupPikaday.jsx
Created April 27, 2018 03:21
Date picker popup using Pikaday
import React, { Component } from 'react';
import moment from 'moment';
import 'pikaday/scss/pikaday.scss';
import FlightSearchHeader from '../../../../components/FlightSearchHeader';
import BackButton from '../../../../components/FlightSearchHeader/BackButton';
import './styles.scss';
let Pikaday;
body{
font-family: Century;
background-color: darkblue;
background: url("windows_8_wallpaper_large.png") fixed;
color: #fff;
padding:20px;
overflow: auto;
overflow-y: hidden;
white-space: nowrap;
}
<!DOCTYPE html>
<html>
<head>
<title>My Awesome React</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="react-app"></div>
<script type="text/javascript" src="/public/bundle-dist.js" charset="utf-8"></script>
import React from 'react'
import { render } from 'react-dom'
import MainWrapper from './components/MainWrapper'
class App extends React.Component
{
render()
{
return (