Skip to content

Instantly share code, notes, and snippets.

View DotAmzi's full-sized avatar
:shipit:
println("Hello Stranger");

Camilo Fernandes DotAmzi

:shipit:
println("Hello Stranger");
  • Coopersystem
  • Brasilia, Brazil
  • 22:12 (UTC -03:00)
  • LinkedIn in/camilodf
View GitHub Profile
4.
<?php
foreach (range(0, 50) as $number) {
if($number%5===0){
echo $number .", ";
}
}
?>
5.
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin

Products

index of products 25 first

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products.json

Show a product

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products/706676762.json

Modify a product

curl -i -X PUT -H "X-Spree-Token: YOUR_TOKEN_ID" -d "product[name]=Headphones" http://0.0.0.0:3000/api/products/706676762.json

@DotAmzi
DotAmzi / database.php
Last active July 6, 2017 17:06
Execute .sql
<?php
$dir = $_GET['dir'];
$files = scandir($dir);
unset($files[0]);
unset($files[1]);
// class pdoDbException extends PDOException {
// public function __construct(PDOException $e) {
@DotAmzi
DotAmzi / teste.c
Last active June 23, 2018 01:30
a
function calc(string nota){
if(nota <= 5) {
return "reprovado";
}
if(nota < 5) {
return "aprovado";
}
}
@DotAmzi
DotAmzi / auth-example.js
Last active December 21, 2018 16:26
auth-example.js
axios.post('/user', {
login: 'teste',
pass: 'tste'
})
.then(function (response) {
return localStorage.setItem("token", data.token);
})
.then(function (response) {
window.location.repace(whatever)
})
@DotAmzi
DotAmzi / receive.js
Created December 21, 2018 17:30
receive data
var token = localStorage.getItem(token);
axios.get(`http://${IpTarget}:3000/graphql/`,
{
headers: {
'Content-Type': 'application/json',
'Authorization': token
}
})
.then((res) => {
@DotAmzi
DotAmzi / contact.php
Created February 7, 2019 13:37
arquivo de contato
<?php
$name = $_POST['name'];
$telephone = $_POST['telephone'];
$mesage_post = $_POST['mesage'];
$to = 'realizesaint@gmail.com';
$subject = 'Novo contato';
$message = '<h2>Contato vindo do site</h2>';
$message .= '<b>Nome:</b> ' . $name . '<br>';
@DotAmzi
DotAmzi / server.js
Created May 28, 2019 18:57
servidor node
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(__dirname + ''));
app.get('/*', function(req,res) {
res.sendFile(path.join(__dirname+'/index.html'));
});
@DotAmzi
DotAmzi / map.js
Last active December 16, 2019 14:20
local
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
</style>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type='text/javascript'>
window.onload = function() {
// find DOM elements