Skip to content

Instantly share code, notes, and snippets.

@manoelstilpen
manoelstilpen / TwitterAuthRetrofit.java
Created April 21, 2019 03:37
Retrofit Interface Twitter API
public interface TwitterAuthAPI {
@Headers({"content-type: application/x-www-form-urlencoded"})
@POST("oauth2/token?grant_type=client_credentials")
Call<BearerCredential> getBearerToken(@Header("authorization") String authorization);
}
@manoelstilpen
manoelstilpen / compile.sh
Created December 1, 2018 13:47
Compiling JSP
chmod +x configure.sh
./configure.sh # install program dependencies
mkdir build # create a directory which will hold compiled files
cd build # enters created directory
cmake .. # generate makefiles
make # compile program
./app -i ../instances/abz5_f13.txt -m vns -p # execution sample running vns algorithm for abz5 instance
@manoelstilpen
manoelstilpen / brightness.sh
Created June 24, 2017 14:32
Script for changing brightness in Linux based systems
#!/bin/bash
# It's necessary give the correct permissions for the brightness file
# Verify the correct path to the brightness file on your pc
# Parameters: "inc" for increment and "dec" for decrement brightness
#get the current brightness
current=`cat /sys/class/backlight/intel_backlight/actual_brightness`
@manoelstilpen
manoelstilpen / gist:6f29e6c5d767f715b5ecd51eab1deec1
Last active June 9, 2017 00:44 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):