Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Matheus Garcia rafael-garcia

View GitHub Profile
View p1_2016_ex2.c
void rotina (int n, int* v) {
int i, temp;
int troca = 0;
for (i=0; i < n-1; i++)
if (v[i] > v[i+1]) {
temp = v[i];
v[i] = v[i+1];
v[i+1] = temp;
troca = 1;
}
@rafael-garcia
rafael-garcia / rg.s
Last active Mar 31, 2018
ROT p1 2017
View rg.s
main:
# n = 6
addi $s0, $zero, 6
# por padrao registradores $aX guardam os params
add $a0, $s0, $zero
# chama rotina
jal ROT
View autoYosemite.sh
#!/bin/bash
fontc=`tput setab 0` # black
back=`tput setaf 2` # green
delim=" %%% "
ColEcho() {
echo "$(tput setab 3)$(tput setaf 4)${delim}${fontc}$1${back}$(tput setab 3)$(tput setaf 4)${delim}"
}
View chatServer.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
You can’t perform that action at this time.