Skip to content

Instantly share code, notes, and snippets.

View Hikari9's full-sized avatar

Rico Tiongson Hikari9

  • Ateneo de Manila University
View GitHub Profile
@Hikari9
Hikari9 / randomized_bounding_ball.cpp
Created May 5, 2017 03:54
Randomized Bounding ball
#include <iostream>
#include <cmath>
#include <complex>
#include <algorithm>
using namespace std;
typedef complex<double> point;
#define x real()
#define y imag()
#define EPS 1e-7
#define PRECISION 12
@Hikari9
Hikari9 / motivation-ball.js
Last active May 29, 2017 12:29
Motivation Ball, scrapes from InspirationalShit.com
#!/usr/bin/node
var fs = require('fs');
var os = require('os');
var path = require('path');
var request = require('request');
var cheerio = require('cheerio');
var exec = require('child_process').exec;
var icon = '/home/rico/.local/share/icons/hicolor/Chibi-PNG-File.png';
/**
@Hikari9
Hikari9 / input.conf
Last active May 4, 2024 21:45
MPV Config File for Ceylon (anime)
AXIS_UP ignore
AXIS_DOWN ignore
AXIS_LEFT ignore
AXIS_RIGHT ignore
MOUSE_BTN3 add volume 5
MOUSE_BTN4 add volume -5
MOUSE_BTN5 seek -5
MOUSE_BTN6 seek 5
@Hikari9
Hikari9 / grub
Created April 10, 2017 11:55
My grub command line argument for ASUS K501 UW for backlight brightness
GRUB_CMDLINE_LINUX_DEFAULT="video.use_native_backlight=1 acpi_backlight=native acpi_osi="
@Hikari9
Hikari9 / tester.py
Last active March 11, 2017 03:48
Judge tester
import sys
import os
import os.path
import time
JUDGE_INPUT_FORMATS = ['judge%04d.in', 'judge%d.in']
JUDGE_OUTPUT_FORMATS = ['judge%04d.ans', 'judge%d.ans']
TEST_OUTPUT_FORMAT = 'judge%04d.test.out'
def compare_files(a, b):
@Hikari9
Hikari9 / build.gradle
Created February 21, 2017 14:11
Android Gradle dependency template
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId APPLICATION_ID // change this
minSdkVersion 19
targetSdkVersion 25
@Hikari9
Hikari9 / .autocompile.sh
Last active April 15, 2017 08:36
Save autorun for Atom Editor C++
#/bin/bash
# kill current running processes first
kill $(ps -ax | grep "$(cat test.runformat)" | awk '{print $1;}' | paste -sd " " -) 2>> /dev/null &
echo "Running $0"
# compile first if argument is supplied
if [ $# -eq 1 ]; then
# compile and run file
@Hikari9
Hikari9 / alias.cpp
Created August 29, 2016 09:54
Windows Alias
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *args[]) {
if (argc < 3) {
invalid: cout << "usage: alias name \"command\"" << endl;
return 0;
}
@Hikari9
Hikari9 / hasse.py
Created August 26, 2016 10:35
Hasse Matrix with Path Recovery
# coding=utf-8
def hedetniemi(A, B):
return [[min(A[i][k] + B[k][j] for k in range(len(A))) for j in range(len(A))] for i in range(len(A))]
def hasse(D, k):
return reduce(hedetniemi, [D]*(k - 1), D)
def hasse_recovery(D, k):
if k == 1:
@Hikari9
Hikari9 / template.html
Created June 23, 2016 13:01
template.html
<!DOCTYPE html>
<html lang='en'><head>
<meta charset='utf-8'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script>
<script src='https://code.jquery.com/ui/1.11.4/jquery-ui.min.js' integrity='sha256-xNjb53/rY+WmG+4L6tTl9m6PpqknWZvRt0rO1SRnJzw=' crossorigin='anonymous'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>
<title>Index</title>
</head><body><main id='main' class='container-fluid'>
Hello World