Skip to content

Instantly share code, notes, and snippets.

View coderinblack08's full-sized avatar
🚢
shippin

Kevin Lu coderinblack08

🚢
shippin
View GitHub Profile
@coderinblack08
coderinblack08 / linux.bash
Created December 31, 2022 21:38 — forked from DevTrunk/linux.bash
Two scripts for Windows and Linux to install aseprite
#!/bin/bash
(
ABSPATH=$(readlink -f $0)
ABSDIR=$(dirname $ABSPATH)
echo "Download and install all necesarry things"
sudo apt-get install -y curl g++ cmake ninja-build libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev libfontconfig1-dev
curl -L -o skia.zip https://github.com/aseprite/skia/releases/download/m81-b607b32047/Skia-Linux-Release-x64.zip
#!/usr/bin/env bash
set -e
target_osx=$(sw_vers -productVersion)
project_dir=/Users/rkmax/development/aseprite
skia_dir=/Users/rkmax/development/skia
arch="$(uname -m)"
bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg
@coderinblack08
coderinblack08 / index.ts
Created September 23, 2020 03:06
Simple type-graphql, typeorm index file
import 'reflect-metadata';
import cors from 'cors';
import express from 'express';
import { createConnection } from 'typeorm';
import { port, __prod__ } from './constants';
import { ApolloServer } from 'apollo-server-express';
import { buildSchema } from 'type-graphql';
import { HelloResolver } from './resolvers/HelloResolver';
const main = async () => {
@coderinblack08
coderinblack08 / template.cpp
Created August 14, 2020 18:23
My c++ template for USACO
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void setIO(string s) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"removeComments": true,
// Problem Statement: 2D Peak Finder Algorithm
// Key concept: Divide and Conquer Strategy
// MIT Link: https://courses.csail.mit.edu/6.006/spring11/lectures/lec02.pdf
const matrix = [
[10, 8, 10, 10],
[14, 13, 12, 11],
[15, 9, 11, 21],
[16, 17, 19, 20]
],
// Problem Statement: 1D Peak Finder Algorithm
// Key concept: Divide and Conquer Strategy
// MIT Link: https://courses.csail.mit.edu/6.006/spring11/lectures/lec02.pdf
const list = [1, 2, 6, 5, 3, 7, 4];
const findPeak = (list, h) => {
if (list[h - 1] <= list[h] && list[h] >= list[h + 1])
return list[h];
else if (list[h - 1] > list[h])
@coderinblack08
coderinblack08 / index.js
Created May 21, 2020 20:06
Basic Express App
const express = require('express');
const cors = require('cors');
const volleyball = require('volleyball');
require('dotenv').config();
const app = express();
const port = process.env.PORT || 3030;
// Built in 'Body Parser' middleware for express
app.use(express.json());