Skip to content

Instantly share code, notes, and snippets.

@tungpun
tungpun / gist:1d3e37d8df652435f295
Last active August 29, 2015 14:21
Bresenham - CG Self Review
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
int sign(double x) {
if (x < 0) return (-1);
else return 1;
}
@tungpun
tungpun / gist:29660f3e9450be3d1b4f
Last active September 3, 2015 15:05
NLP - first assignment
import re
def standalize(paragraph):
paragraph = paragraph.strip()
paragraph = re.sub(r'([,/;!?.(){}:=@#$%^&*\[\]<>\-\+])', r' \1 ', paragraph)
while paragraph.find(' ') != -1:
paragraph = paragraph.replace(' ', ' ')
return paragraph
@tungpun
tungpun / ohyeahfw.py
Last active November 16, 2015 14:52
A simple wrapper of iptables....
#!/usr/bin/python2.7
"""
A wrapper of IPTables
"""
import os
D_IP = '0.0.0.0'
def basic_color(code):
@tungpun
tungpun / Preferences.sublime-settings -- User
Created March 14, 2018 10:10
Sublime Text 3's settings
{
"always_show_minimap_viewport": true,
"auto_complete_function_params": "required",
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source.python"
}
],
A32
AAA
AAS
AAT
AAV
ABB
ABC
ABI
ABR
ABS
apiVersion: v1
kind: Pod
metadata:
labels:
run: my-pod
name: my-pod
spec:
containers:
- image: amazon/aws-cli
name: my-aws-cli
apiVersion: v1
kind: Pod
metadata:
name: test
labels:
app: test
spec:
containers:
- image: ubuntu
command:
@tungpun
tungpun / google-cloud-cli-pod.yaml
Last active November 29, 2023 10:33
google-cloud-cli-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: google-cloud-cli
namespace: test
labels:
app: google-cloud-cli
spec:
containers:
- image: gcr.io/google.com/cloudsdktool/google-cloud-cli:latest
@tungpun
tungpun / http-benchmark.md
Created December 15, 2023 03:46 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
# ~/.config/starship.toml
[conda]
disabled = true
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"