This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd shortcurs | |
alias ..='cd ..' | |
alias ...='cd ../../../' | |
alias ....='cd ../../../../' | |
alias .....='cd ../../../../' | |
alias .4='cd ../../../../' | |
alias .5='cd ../../../../..' | |
# smart mkdir | |
alias mkdir='mkdir -pv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "linkedlist.h" | |
// insert in the end of the list | |
void append(int element, list **l) { | |
} | |
// removes a specific element from the list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _LINKEDLIST_H | |
#define _LINKEDLIST_H | |
#define remove(element, l) _list_remove(element, l) | |
struct node { | |
int data; | |
struct node *next; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// arquivo: prodcons.c | |
// descricao: Programa produtor-consumidor com mutex | |
// Utiliza a biblioteca pthreads. | |
// para compilar: cc -o phtread pthread.c -lpthread | |
#include <pthread.h> | |
#define FALSE 0 | |
#define TRUE 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal. | |
original code adapted from juancarlospaco: | |
- http://ubuntuforums.org/showpost.php?p=10306676 | |
Inspired by the movie: The Matrix | |
- Corey Goldberg (2013) | |
Requires: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# A git hook script to find and fix trailing whitespace | |
# in your commits. Bypass it with the --no-verify option | |
# to git-commit | |
# Ref - http://is.gd/PerowD | |
# | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This will abort "git commit" and remove the trailing whitespaces from the files to be committed. | |
# Simply repeating the last "git commit" command will do the commit then. | |
# | |
# Put this into .git/hooks/pre-commit, and chmod +x it. | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://sourcecode4u.com/sortings/8-heapsort | |
http://www.algorithmist.com/index.php/Heap_sort.c | |
http://www.thelearningpoint.net/computer-science/arrays-and-sorting-heap-sort--with-c-program-source-code | |
http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/heapSort.htm | |
http://rosettacode.org/wiki/Sorting_algorithms/Heapsort#C | |
http://www.lemoda.net/c/qsort-example/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Navigation: File] | |
Ctrl-f #page down | |
Ctrl-b #page up | |
Ctrl-d #half page down | |
Ctrl-u #half page up | |
Shift-g #end of the file | |
g #top of the file | |
Shift-h #top of screen view | |
Shift-m #middle of screen view |