Skip to content

Instantly share code, notes, and snippets.

View jair-anderson-souza's full-sized avatar

Jair Anderson Souza jair-anderson-souza

View GitHub Profile
@petrvolny
petrvolny / snake.c
Last active May 13, 2023 10:19
Simple ncurses snake game (inspired by the famous nokia snake mobile game). I used this as an example when I was teaching Introduction to Programming class on Masaryk University during my PhD studies few years ago (https://is.muni.cz/auth/predmet/fi/podzim2011/IB001?lang=en;setlang=en)
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <curses.h>
#define SNAKE_MAX_LENGTH 12
#define WIN_MSG "You are the WINNER!"
#define WELCOME_MSG "We present you the ultimate SNAKE game!!!"
#define LOST_MSG "Loooooser :-))))"
#define UP 1
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active October 22, 2024 12:13
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 17, 2024 18:07
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@robinwarren
robinwarren / dashboard.html
Last active January 28, 2022 17:15
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">
@thpoiani
thpoiani / docker.sh
Created December 4, 2015 05:40
Docker (Containers com Docker - Daniel Romero - Casa do Código)
# Installation
$ sudo apt-get update
$ sudo apt-get install build-essential python-software-properties git
$ sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
$ sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update && apt-get install docker
# Hello, Docker
@schmidt1024
schmidt1024 / location.ts
Last active October 5, 2021 17:23
start external map navigation from ionic 2 app for ios and android; needs cordova-plugin-geolocation
startExternalMap() {
if (this.location.latitude) {
this.platform.ready().then(() => {
Geolocation.getCurrentPosition().then((position) => {
// ios
if (this.platform.is('ios')) {
window.open('maps://?q=' + this.location.name + '&saddr=' + position.coords.latitude + ',' + position.coords.longitude + '&daddr=' + this.location.latitude + ',' + this.location.longitude, '_system');
};
// android
if (this.platform.is('android')) {
@danilosilvadev
danilosilvadev / LambdaExpressionsInLessThanTwoMinute.md
Last active April 27, 2021 21:07
Lambda Expressions in less than 2 minutes

Sample:

Fact 1 - Consider the methods has 2 parts: HEAD(public void nameOfMethod(Input input)) and BODY({Everything inside the keys}).

//without lambda you still use the HEAD as always.
    public void printName() {
        System.out.println(“Print without lambda”);
 }
@ellerbrock
ellerbrock / Free O'Reilly Books.md
Last active October 14, 2024 20:37 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.