Skip to content

Instantly share code, notes, and snippets.

View koswarabilly's full-sized avatar

Billy koswarabilly

View GitHub Profile
@koswarabilly
koswarabilly / 1
Last active July 30, 2020 09:11
kickstartRoundB
const fs = require('fs');
const input = fs.readFileSync('./1RB.txt', 'utf8').trim().split('\n');
let currentline = 0;
function readline(){
return input[currentline++];
}
let T = readline();
@koswarabilly
koswarabilly / 1
Last active July 30, 2020 05:12
kickstart 2020 round A
// #1
const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trim().split('\n');
let currentline = 0;
function readline(){
return input[currentline++];
}
CREATE OR REPLACE FUNCTION sch_p000.migrate_schema_table(p_to_schema character varying)
RETURNS boolean
LANGUAGE plpgsql
AS $function$DECLARE
v_query CHARACTER VARYING;
v_seq CHARACTER VARYING;
v_table CHARACTER VARYING;
v_col CHARACTER VARYING;
v_col_def CHARACTER VARYING;
v_routine CHARACTER VARYING;
@koswarabilly
koswarabilly / WebSocketController.php
Created June 19, 2020 08:08 — forked from Mevrael/WebSocketController.php
Laravel + WebSocket (Ratchet/ReactPHP) integration
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Session;
use Ratchet\WebSocket\Version\RFC6455\Connection;
@koswarabilly
koswarabilly / query.txt
Last active July 13, 2020 08:21
PostgreSQL Query Helper
drop user darkogl_developer;
create role group_darkogl_support;
CREATE USER darkogl_support
with
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
PASSWORD 'glsupport';
@koswarabilly
koswarabilly / app.html
Last active June 19, 2020 03:03
Angular load compiled project
<div id="htmlcontainer" [innerHTML]="myTemplate"></div>
@koswarabilly
koswarabilly / socket-server-basic.php
Created June 18, 2020 10:01
PHP Ratchet Websocket Basic & Custom Endpoint
<?php
use Ratchet\Server\IoServer;
use MyApp\Chat; // Your own class to handle websocket message
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
require dirname(__DIR__) . '/vendor/autoload.php';
$server = IoServer::factory(
@koswarabilly
koswarabilly / sample-nginx.conf
Created October 16, 2018 07:59 — forked from dimitardanailov/sample-nginx.conf
Configuration for Laravel 5 application and Nginx
server {
listen 80 default deferred;
server_name laravel-application.com;
# http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
access_log /var/www/laravel-app/access.log;
error_log /var/www/laravel-app/error.log;
root /var/www/laravel-app/public/;
@koswarabilly
koswarabilly / index.js
Created September 26, 2018 09:55 — forked from AlexBrasileiro/index.js
ShareYourFeedback
// inspiration: https://dribbble.com/shots/4370657-Share-Your-Feedback
import React, { Component, Fragment } from "react";
import { Animated, StyleSheet, Text, View, TouchableOpacity, Dimensions, Platform, Easing, TextInput, KeyboardAvoidingView, Image } from "react-native";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const { width: windowWidth } = Dimensions.get('window');
const Icon = (props) => <FontAwesome5 {...props} />
@koswarabilly
koswarabilly / array-of-currency
Created May 9, 2018 09:41
Who ever need an array of currency in object pack
[
{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},