This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Note: Eliminate `-WhatIf` parameter to get action be actually done | |
| Note: PS with version prior to 4.0 can't delete non-empty folders | |
| #> | |
| Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const NowClient = require('now-client') | |
| const now = new NowClient() | |
| console.log('> Running deployment script') | |
| now.getDeployments().then(deployments => { | |
| console.log('> Removing active deployments') | |
| const active = deployments.filter(deploy => deploy.name === require('../package.json').name && deploy.scale.current >= 1) | |
| if(active.length >= 1) | |
| active.forEach(deploy => now.deleteDeployment(deploy.uid).then(removed => console.log('> Removed deployment %s', deploy.url))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function checkToken(req, res, next) { | |
| var token = req.body.token || req.query.token || req.headers['x-access-token']; | |
| if (token) { | |
| jwt.verify(token, app.get('secret'), function(err, decoded) { | |
| if (err) { | |
| return res.json({ success: false, code: 'TOKEN_FAIL', message: 'Token inváido' }); | |
| } else { | |
| req.decoded = decoded; | |
| next(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const app = express() | |
| app.use(bodyParser.json()) | |
| app.use(bodyParser.urlencoded({extended: false})) | |
| const usuarios = [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const app = express() | |
| app.use(bodyParser.json()) | |
| app.use(bodyParser.urlencoded({extended: false})) | |
| app.get('/', (req, res) => { | |
| res.send('Hello World') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Verifying my Blockstack ID is secured with the address 1FGkYWJwmgfFBhEhr4qjDADE3rXw7vKmEd https://explorer.blockstack.org/address/1FGkYWJwmgfFBhEhr4qjDADE3rXw7vKmEd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package HMP_Bank; | |
| public class Account { | |
| public int id; | |
| private double saldo = 0; | |
| private String senha; | |
| public String usuario; | |
| public Cliente cliente; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Lista4; | |
| import java.util.Scanner; | |
| public class Ex401 { | |
| public static void main(String[] args){ | |
| Scanner s = new Scanner(System.in); | |
| int[] vet = new int[5]; | |
| for(int x = 0; x < 5; x++) { | |
| System.out.println("Digite um número: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Lista3; | |
| import java.util.Scanner; | |
| public class Ex301 { | |
| public static void main(String[] args) { | |
| Scanner s = new Scanner(System.in); | |
| double x = 0; | |
| do { | |
| System.out.println("Digite uma nota entre 0 e 10"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company; | |
| import java.util.Scanner; | |
| public class Ex201 { | |
| public static void main(String[] args) { | |
| Scanner s = new Scanner(System.in); | |
| System.out.print("Digite um número: "); | |
| int num1 = s.nextInt(); | |
| System.out.print("Digite outro número: "); |
NewerOlder