Skip to content

Instantly share code, notes, and snippets.

View jotajr's full-sized avatar
🇨🇦
Working and Studying

Jota Freitas Jr jotajr

🇨🇦
Working and Studying
View GitHub Profile
@jotajr
jotajr / Initial.swift
Created March 24, 2017 13:42
Estudos iniciais Swift - Language Overview
//: Playground - noun: a place where people can play
var str = "Hello, playground"
print(str)
// Inicio dos estudos de swift
var optionalString: String? = "Hello"
print(optionalString == nil)
@jotajr
jotajr / curltest.c
Created April 18, 2017 14:08 — forked from aaronhurt/curltest.c
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* Requirements:
*
* json-c - https://github.com/json-c/json-c
* libcurl - http://curl.haxx.se/libcurl/c
*
@jotajr
jotajr / map.cpp
Last active April 19, 2017 18:34
Exemplo de utilizacao de mapa em C++
#include <iostream>
#include <map>
#include <string>
#include <iterator>
int main()
{
std::map<std::string, int> mapaParametros;
// Inserindo dados
@jotajr
jotajr / byobuCommands
Created April 26, 2017 01:00 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@jotajr
jotajr / sshtunnel.sh
Last active April 28, 2017 20:02
Script to create a ssh tunnel to a host
#!/bin/bash
#Script to create a SSH Tunnel by Jota Freitas Jr
clear
echo "SSH Tunnel - Create a Connection"
echo "Let's Config our Dynamic Connection!"
read -p "Enter hostname/IP that you want to connect: " host
@jotajr
jotajr / git.migrate
Created May 11, 2017 14:54 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@jotajr
jotajr / move_repository.sh
Last active February 15, 2023 18:08
[GIT] Migrate a git repository to a new one
#!/bin/bash
# Moving a repo by Jota Jr
echo "Script to migrate a repository to a new origin"
echo "Enter the git repository path: "
read path_repo
class CustomException extends Exception {
private String message = null;
public CustomException() {
super();
}
public CustomException(String message) {
super(message);
-- Jota Freitas Jr - Criar tabelas para controle de Spring Batch
CREATE TABLE BATCH_JOB_INSTANCE (
JOB_INSTANCE_ID NUMBER(19,0) NOT NULL PRIMARY KEY ,
VERSION NUMBER(19,0) ,
JOB_NAME VARCHAR2(100) NOT NULL,
JOB_KEY VARCHAR2(32) NOT NULL,
constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
) ;
-- Jota Freitas Jr - Remover tabelas para controle de Spring Batch
DROP TABLE BATCH_STEP_EXECUTION_CONTEXT ;
DROP TABLE BATCH_JOB_EXECUTION_CONTEXT ;
DROP TABLE BATCH_STEP_EXECUTION ;
DROP TABLE BATCH_JOB_EXECUTION_PARAMS ;
DROP TABLE BATCH_JOB_EXECUTION ;
DROP TABLE BATCH_JOB_INSTANCE ;
DROP SEQUENCE BATCH_STEP_EXECUTION_SEQ ;