Skip to content

Instantly share code, notes, and snippets.

@anakaiti
anakaiti / main.java
Created September 6, 2016 16:16
Problem - 2 - Random Number
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
@anakaiti
anakaiti / main.cpp
Last active September 15, 2016 07:56
Shape Printer
#include <iostream>
#include <stdlib.h>
char unit='#';
using namespace std;
int putunit(){
cout << unit;
}
#include <iostream>
using namespace std;
int var[2] = {999999,1};
void insert(int arg){
if(arg < var[0]) var[0] = arg;
var[1]++;
}
void delete(int arg){
<!DOCTYPE html>
<html>
<head>
<title>Annyang testing</title>
</head>
<body>
<script src="Https://cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>
<p id='p1'></p1>
<script>
window.onload = function(){
@anakaiti
anakaiti / rpi-opencv-python-build.sh
Last active September 25, 2018 17:32
OpenCV 3.4.2 Raspberry Pi Python build
#!/bin/bash
set -ex
# Adapted from https://raspberrypi.stackexchange.com/a/69176
version=3.4.2
mkdir build
cd build
@anakaiti
anakaiti / init.sh
Last active January 2, 2019 04:30
init.sh
#!/usr/bin/env bash
pip install -q gdown
mkdir in out models
gdown -q --id 1hs1PVezw0pFP6dHxDon39iGFzMrqJf18
tar xf fast-style-transfer.tar -C models
wget -qP in "https://my.mixtape.moe/ajvgpk.jpeg"
git clone -q https://github.com/lengstrom/fast-style-transfer.git
mv fast-style-transfer/* .
rm -rf fast-style-transfer
@anakaiti
anakaiti / openpgp.txt
Created February 26, 2019 14:58
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:8bedd140810f69e10f98ae4635b709976dd9e6e3]

Keybase proof

I hereby claim:

  • I am anakaiti on github.
  • I am anakaiti (https://keybase.io/anakaiti) on keybase.
  • I have a public key whose fingerprint is DA93 398B AB18 0D5B AF6B 219D C914 6C79 851E 5FD1

To claim this, I am signing this object:

@anakaiti
anakaiti / unique-list.tf
Created August 12, 2019 05:02
Terraform unique list
locals {
listA = [1, 2, 3, 4]
listB = [2, 3, 4, 5]
}
provider "local" {}
resource "local_file" "name" {
content = "${join(" ", distinct(concat(local.listA, local.listB)))}"
filename = "myfile.txt"
@anakaiti
anakaiti / update-terraform.fish
Created March 10, 2020 09:18
Terraform update script for fish shell
function update-terraform --description 'Updates terraform to the latest version'
set -l base 'https://releases.hashicorp.com/terraform'
set -l ver (curl -s $base/ | grep '<a href="/terraform/' | head -n1 | cut -d'/' -f 3)
set -l tmpdir (mktemp -d)
wget -O $tmpdir/tf.zip $base/$ver/terraform_"$ver"_linux_amd64.zip
unzip $tmpdir/tf.zip -d $tmpdir
install $tmpdir/terraform (which terraform)
terraform version
end