Skip to content

Instantly share code, notes, and snippets.

View ffernandoalves's full-sized avatar
:shipit:
!

Fernando Alves ffernandoalves

:shipit:
!
View GitHub Profile
@1271
1271 / Image.cpp
Created August 27, 2017 21:50 — forked from roxlu/Image.cpp
stbi image loading, super clean png/jpg/psd/hdr loading.
#include <roxlu/experimental/Image.h>
namespace roxlu {
Image::Image()
:width(0)
,height(0)
,pixels(NULL)
{
}
@aunyks
aunyks / snakecoin-server-full-code.py
Last active March 31, 2025 17:45
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@walsvid
walsvid / highlightc++.tex
Created February 25, 2017 10:51
Highlight-C++-LaTeX
documentclass{ctexart}
\usepackage{listings}
\usepackage{xcolor}
% 定义可能使用到的颜色
\definecolor{CPPLight} {HTML} {686868}
\definecolor{CPPSteel} {HTML} {888888}
\definecolor{CPPDark} {HTML} {262626}
\definecolor{CPPBlue} {HTML} {4172A3}
\definecolor{CPPGreen} {HTML} {487818}
\definecolor{CPPBrown} {HTML} {A07040}
@physacco
physacco / README.md
Last active December 8, 2024 07:48
Python 3 extension example

Python 3 extension example

Build

python3 setup.py build

Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so

Run

@rochacbruno
rochacbruno / Makefile
Last active June 22, 2022 23:35
Python Setup Tips and Tricks http://j.mp/setup_py
.PHONY: test install pep8 release clean
test: pep8
py.test --cov -l --tb=short --maxfail=1 program/
install:
python setup.py develop
pep8:
@flake8 program --ignore=F403 --exclude=junk
@joepie91
joepie91 / vpn.md
Last active April 16, 2025 15:17
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
cmake_minimum_required(VERSION 2.8.4)
project(so29595222)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES python_threading_example_so29595222.cpp)
@mr-linch
mr-linch / camera.py
Created June 8, 2014 10:19
First person camera for pyglet
# -*- coding: utf-8 -*-
import math
import collections
import pyglet
class FirstPersonCamera(object):
"""First person camera implementation
@fredRos
fredRos / PKG-INFO
Last active May 18, 2024 15:48
Minimal example to demonstrate how to use the sampler written in python to sample from a class method defined in C++. It also shows how get it to run with mpi4py to run on hundreds of processors.
Metadata-Version: 1.0
Name: fred_emcee_swig
Version: 1.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
@mzabriskie
mzabriskie / README.md
Last active March 2, 2025 10:55
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.