Skip to content

Instantly share code, notes, and snippets.

//
// main.swift
// SwiftTests
//
// Created by Thiago Andrade on 2017-01-08.
// Copyright © 2017 Thiago Andrade. All rights reserved.
//
import Foundation
@thiagoh
thiagoh / bash-utils.sh
Last active March 23, 2017 18:10
bash util commands
# kill a specific process
$ ps aux | grep $process_to_kill_name | tr -s ' ' | cut -d ' ' -f2 | xargs kill -9
# read a specific $gist_nth gist
$ gist --list | head -n $gist_nth | cut -d ' ' -f1 | rev | cut -d '/' -f1 | rev | xargs gist -r
@thiagoh
thiagoh / SMBDIS.ASM
Created January 25, 2017 22:42 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
/*
* This code was inspired by AngularJS $resource object
* on which you can do something like this:
var users = User.query(function() {
console.log(users[0]);
});
* Source code: https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L76
*/
@thiagoh
thiagoh / basic-media-queries.html
Last active March 4, 2017 21:24
basic media queries
<!doctype html>
<html>
<head>
<title>My First HTML Page</title>
<!--<meta name="viewport" content="width=1200, initial-scale=1">-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#left {
@thiagoh
thiagoh / floating.css
Created March 13, 2017 03:05
floating left experiments
<!doctype html>
<html>
<head>
<style type="text/css">
div {
padding: 10px;
border: 1px solid black;
margin: 0px;
float: left;
@thiagoh
thiagoh / instanceof.cpp
Last active March 25, 2017 07:56
c++ good stuff
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <typeinfo>
#include <type_traits>
namespace com::test {
class BaseClass {
@thiagoh
thiagoh / watchfiles.md
Last active June 8, 2023 15:56
watchfiles: Watch multiple files and execute bash commands as file changes occur

watchfiles

  • author: Thiago Andrade [email protected]
  • license: GPLv3
  • description:
  • watches the given paths for changes
  • and executes a given command when changes occur
  • usage:
  • watchfiles <paths...>
@thiagoh
thiagoh / C Data Types - Handbook.md
Last active April 30, 2017 23:10
C Data Types - Handbook

C Data Types - Handbook

[C Data Types][17]

Table of Contents

C/C++ provides various data types that can be used in your programs.

In general, you'd commonly use:

@thiagoh
thiagoh / ctail
Last active May 18, 2017 16:29
Colored tail -f
#!/bin/bash
macos="\x1B"
linux="\033"
marker=$linux
if echo $(uname -a) | grep -q -i "darwin"; then
marker=$macos
fi