Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# -*- coding: utf-8 -*-
import websocket
import _thread as thread
import time
class Database:
dados = []
@calimaborges
calimaborges / .block
Created April 22, 2020 01:54
fresh block
license: mit
@calimaborges
calimaborges / webpack.config.js
Created July 21, 2017 20:22
Webpack Basic Config Example
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const webpack = require("webpack");
module.exports = {
devtool: "source-map",
entry: "./src/index.js",
output: {
filename: "[name].[hash].js",
@calimaborges
calimaborges / config.sh
Created July 17, 2017 16:35
Swap Memory Config Digital Ocean
# Configure swap memory
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
shutdown -r now
@calimaborges
calimaborges / App.java
Last active November 16, 2016 15:58
Simple HTTP Client
package carlosborges.httpclient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
public class App {
public static void main( String[] args ) throws IOException {
@calimaborges
calimaborges / App.java
Last active July 16, 2016 03:04
workflow-back-end-java-part4-teste-automatizado
package carlosborges.taskify;
import static spark.Spark.*;
public class App {
public static void main( String[] args ) {
App app = new App();
app.start(System.getenv("PORT"));
}
@calimaborges
calimaborges / App.java
Last active July 16, 2016 02:24
workflow-back-end-java-part3-deploy-com-heroku
package carlosborges.taskify;
import static spark.Spark.*;
public class App {
public static void main( String[] args ) {
String strPort = System.getenv("PORT") != null ? System.getenv("PORT") : "4567";
port(Integer.valueOf(strPort));
get("/", (req, res) -> "Hello World");
}
@calimaborges
calimaborges / .gitignore
Created July 15, 2016 22:40
workflow-back-end-java-parte2-versionando-com-git-github
.idea
*.iml
target
@calimaborges
calimaborges / .editorconfig
Last active July 16, 2016 02:23
workflow-back-end-java-parte1-hello-world-spark
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 80
@calimaborges
calimaborges / versao1.java
Last active July 4, 2016 17:20
IoC and Factory
class TarefaRepository {
public List<Tarefa> listaTarefas() {
return new ArrayList<Tarefa>() {{
add(new Tarefa("titulo 1", "descricao 1"))
add(new Tarefa("titulo 2", "descricao 2"))
}};
}
}