Skip to content

Instantly share code, notes, and snippets.

View posva's full-sized avatar
🙏
sponsor me on GitHub

Eduardo San Martin Morote posva

🙏
sponsor me on GitHub
View GitHub Profile
@posva
posva / vv
Last active August 29, 2015 13:57
#! /bin/bash
# Open multiple files in vim
# Every hpp, cpp couple is opened in a separted tab
# by Eduardo San Martin Morote aka Posva
# http://posva.net
HPP="hpp"
CPP="cpp"
function _set_T() {
@posva
posva / boot-key.sh
Last active August 29, 2015 13:55
Creates a bootable key on OSX
#! /bin/bash
good() {
echo "$@"
}
msg() {
echo "$@"
}
@posva
posva / ping-local
Last active January 3, 2016 00:29
typo
#! /bin/bash
# local-ping
# Simple script to check for reachable addresses in a local network
# Base IP for the local network. It an also be a 10.0.0 or anything else
BASE_IP=192.168.1.
# Wait time. Usually between 1 and 3
WAIT=2
# Number of packets to send
COUNT=3
@posva
posva / vim.rb
Created November 14, 2013 12:49
Homebrew Formula to install vim with python support and many other things. Originally from http://mikegrouchy.com/blog/2012/05/compile-vim-with-python-support-on-osx-with-homebrew.html
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@posva
posva / Makfile
Created August 18, 2013 17:40
Simple Makefile for C/C++ projects that work even adding new files. The dependencies are not fully correct though. Yet this Makefiles is really useful. Use the src/, obj/, bin/ structure
CXX = g++
OBJ = obj
SRC = src
BIN = bin
STD := -std=c++0x
EXT_IL := -I$(SRC)
MAIN := Test
TEST_DIR := tests
@posva
posva / FPS.hpp
Created July 22, 2013 10:24
Simple FPS display for SFML2
#pragma once
#include <SFML/Graphics/Text.hpp>
#include <SFML/System/Clock.hpp>
#include <sstream>
class FPS : public sf::Text {
sf::Clock myClock;
unsigned int mySteps;
@posva
posva / quote
Created May 17, 2013 19:45
Color formatted code for zsh (may work in other terminals) to display a random quote from http://www.quotationspage.com/random.php3
#! /bin/zsh
Q=$(curl -s "http://www.quotationspage.com/random.php3" | grep -m 1 "dt ")
TXT=$(echo "$Q" | sed -e 's/<\/dt>.*//g' -e 's/.*html//g' -e 's/^[^a-zA-Z]*//' -e 's/<\/a..*$//g')
W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
echo "\e[0;33m${W}\033[0\e[0;30m: \e[0;35m“${TXT}”\e[m"