Skip to content

Instantly share code, notes, and snippets.

David Landa uetoyo

Block or report user

Report or block uetoyo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@uetoyo
uetoyo / gist:4057486628fcac6798ad84588e220ee6
Created Jul 23, 2019 — forked from jaguilar/gist:5533466
Clang format on save in sublime text 3
View gist:4057486628fcac6798ad84588e220ee6
import sublime, sublime_plugin
import subprocess
class ClangFormatCommand(sublime_plugin.TextCommand):
def run(self, edit):
r = sublime.Region(0, self.view.size())
try:
p = subprocess.Popen(
['clang-format', '--style', 'Google'],
stdin=subprocess.PIPE,
@uetoyo
uetoyo / __main__.py
Created Mar 31, 2019 — forked from linuxluigi/__main__.py
Python __main__.py parser example
View __main__.py
import argparse
# import data2tabshop
# from data2tabshop import __version__
__version__ = '0.1.0'
__author__ = u'Steffen Exler'
def get_parser():
@uetoyo
uetoyo / openicon.c
Created Jan 9, 2019 — forked from armornick/openicon.c
Draw an Image with SDL2
View openicon.c
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#define WIDTH 800
#define HEIGHT 600
#define IMG_PATH "exit.png"
int main (int argc, char *argv[]) {
@uetoyo
uetoyo / gist:70225b0ca8add2ad3c0fe940de2ed69f
Created Aug 21, 2018 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
View gist:70225b0ca8add2ad3c0fe940de2ed69f
"""making a dataframe"""
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
"""quick way to create an interesting data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
"""convert a dictionary into a DataFrame"""
"""make the keys into columns"""
df = pd.DataFrame(dic, index=[0])
@uetoyo
uetoyo / postgres.py
Created Aug 14, 2018 — forked from goldsborough/postgres.py
Python psycopg2 wrapper
View postgres.py
###########################################################################
#
## @file postgres.py
#
###########################################################################
import psycopg2
###########################################################################
#
View why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@uetoyo
uetoyo / auto-deploy_documentation.md
Created Feb 4, 2018 — forked from vidavidorra/auto-deploy_documentation.md
Auto-deploying Doxygen documentation to gh-pages with Travis CI
View auto-deploy_documentation.md

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

@uetoyo
uetoyo / auto-deploy_documentation.md
Created Feb 4, 2018 — forked from vidavidorra/auto-deploy_documentation.md
Auto-deploying Doxygen documentation to gh-pages with Travis CI
View auto-deploy_documentation.md

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

@uetoyo
uetoyo / README.md
Created Jan 6, 2018 — forked from bruth/README.md
Postgres push notification
View README.md

Postgres push triggers

Watch a table for changes and push a notification with a payload describing the change.

Example

In the Postgres shell:

-- Create the functions
@uetoyo
uetoyo / Makefile
Created Dec 29, 2017 — forked from maxtruxa/Makefile
Generic makefile for C/C++ with automatic dependency generation, support for deep source file hierarchies and custom intermediate directories.
View Makefile
# output binary
BIN := test
# source files
SRCS := \
test.cpp
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file)
DISTFILES := $(BIN)
You can’t perform that action at this time.