Skip to content

Instantly share code, notes, and snippets.

View quangIO's full-sized avatar
🥷

Quang Luong quangIO

🥷
View GitHub Profile
import com.fasterxml.jackson.databind.ObjectMapper
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnType
import org.jetbrains.exposed.sql.Table
import org.postgresql.util.PGobject
import java.sql.PreparedStatement
/**
<template>
<div id="app">
<div class="row flex-center flex-middle">
<label for="msg">Message</label>
<input class="margin" type="text" id="msg" v-model="message">
</div>
<div class="row flex-center">
<button class="paper-btn margin" @click="send">Send</button>
</div>
</div>
@quangIO
quangIO / spnsors.svg
Last active May 24, 2018 10:18
SheCodes sponsor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package com.basicsec.demoweb
import io.jsonwebtoken.Jwts
import io.vertx.core.AbstractVerticle
import io.vertx.core.Vertx
import io.vertx.core.json.JsonObject
class MainVerticle : AbstractVerticle() {
@quangIO
quangIO / PKGBUILD
Created December 2, 2018 07:28
Seastar PKGBUILD for Arch Linux
pkgname=seastar-git
pkgdesc='High performance server-side application framework'
pkgver=r3925.c79e9dec
pkgrel=1
arch=('x86_64')
url='https://github.com/scylladb/seastar'
license=('Apache-2')
depends=('hwloc' 'boost' 'boost-libs' 'hwloc' 'numactl' 'libpciaccess' 'crypto++' 'libxml2' 'xfsprogs' 'gnutls' 'lksctp-tools' 'lz4' 'systemtap' 'libtool' 'yaml-cpp')
makedepends=('git' 'python' 'cmake' 'ninja' 'gcc' 'ragel')
`timescale 1ns / 1ps
`define BRUSH_X(idx, size) (h_cnt <= (H_START + pos[idx][0] + size) * SCALE_X) && (h_cnt >= (H_START + pos[idx][0] - size) * SCALE_X)
`define BRUSH_Y(idx, size) (v_cnt <= (V_START + pos[idx][1] + size) * SCALE_Y) && (v_cnt >= (V_START + pos[idx][1] - size) * SCALE_Y)
`define BRUSH_C(idx, size, color) (((h_cnt - H_START - pos[idx][0]) * (h_cnt - H_START - pos[idx][0]) + (v_cnt - V_START - pos[idx][1]) * (v_cnt - V_START - pos[idx][1]) < size * size * SCALE_X * SCALE_Y) ? color : 3'd0)
`define BRUSH(idx, size_x, size_y) (`BRUSH_X(idx, size_x) && `BRUSH_Y(idx, size_y))
`define BRUSH_SCORE(idx) ((h_cnt <= (H_START + (score[idx] << 2)) * SCALE_X) * SCALE_X && v_cnt <= (V_START + (idx << 2) + 4) * SCALE_Y && v_cnt >= (V_START + (idx << 2)) * SCALE_Y)
module vga640x480(
input clk,
output vs,
@quangIO
quangIO / ldd-pack.sh
Created December 22, 2018 05:13
Copy all deps to dest folder
ldd /bin/ls | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' dest
@quangIO
quangIO / Dockerfile
Last active August 18, 2019 06:21
Test against reference implementation
FROM base/archlinux
RUN pacman -Syuq --needed --noconfirm git base-devel sudo
RUN echo "Defaults lecture = never" > /etc/sudoers.d/privacy \
&& echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/wheel \
&& useradd -m -G wheel -s /bin/bash builder
USER builder
WORKDIR /home/builder
Set
i "Project" / 1*8 /
j "Atributes" / person_weeks, labors, crane, profit, perm /;
Table p1(i, j) "Parameters for the problem"
person_weeks labors crane profit perm
1 8 6 1 80 70
2 12 5 0 110 80
3 13 4 1 100 50
4 11 7 0 90 30
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.