REST API para leitura de contracheques do estado da ParaÃba.
POST https://contrachequepb.herokuapp.com/api/contracheques/login
require 'net/http' | |
require 'json' | |
def listar_usuarios(quantidade, my_proc) | |
uri = URI('http://jsonplaceholder.typicode.com/users') | |
response = Net::HTTP.get(uri) | |
JSON.parse(response) | |
my_proc.call(quantidade) | |
yield JSON.parse(response) if block_given? | |
puts "Finalizando listagem de usuarios" |
$(function() { | |
$('#id-do-form').submit(function() { | |
var valuesToSubmit = $(this).serialize(); | |
$.ajax({ | |
type: "POST", | |
url: $(this).attr('action'), //sumbits it to the given url of the form | |
data: valuesToSubmit, | |
dataType: "JSON" // you want a difference between normal and ajax-calls, and json is standard | |
}).success(function(json){ | |
console.log("success", json); |
fetch('/users', { | |
method: 'POST', | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json', | |
'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').getAttribute('content')}, | |
credentials: 'same-origin', | |
body: JSON.stringify( { id: 1, name: 'some user' } ) | |
}) | |
.then(function(data) { |
/* Allow Landscape mode for specific ViewControllers */ | |
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { | |
UIViewController* topVC = [self topViewControllerWith: self.window.rootViewController]; | |
if ([topVC respondsToSelector:@selector(canRotate)]) { | |
return UIInterfaceOrientationMaskAllButUpsideDown; | |
} | |
return UIInterfaceOrientationMaskPortrait; | |
} | |
/* get the top ViewController */ |
import UIKit | |
extension CGFloat { | |
/** Targeting the Photo Book API, converts pixels to points */ | |
var pixelToPoints: CGFloat { | |
let pointsPerInch: CGFloat = 72 | |
let scale: CGFloat = UIScreen.main.scale | |
let pixelPerInch: CGFloat | |
if UIDevice.current.userInterfaceIdiom == .pad { |
#!/bin/bash | |
REMOTE=play@SERVER_IP | |
REMOTE_APP=/home/play/PROJECT_NAME/ | |
sbt stage || exit 1; | |
rsync -va target/ $REMOTE:$REMOTE_APP/target; | |
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh"; | |
ssh $REMOTE "cd $REMOTE_APP; ./start.sh"; |
To show the generated SQL using slick ad Play framework:
add this line to application.conf
logger.scala.slick.jdbc.JdbcBackend.statement=DEBUG
Add those lines to logback.xml
find . -regex ".*/target" -exec rm -r {} + |