This file contains 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
// Get all users | |
var url = "http://localhost:8080/api/v1/users"; | |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', url, true) | |
xhr.onload = function () { | |
var users = JSON.parse(xhr.responseText); | |
if (xhr.readyState == 4 && xhr.status == "200") { | |
console.table(users); | |
} else { | |
console.error(users); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Countries CRUD</title> | |
<style> | |
input[type='submit'], button, [aria-label]{ | |
cursor: pointer; | |
} | |
#spoiler{ |
This file contains 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 morgan = require('morgan') | |
const jwt = require('jsonwebtoken') | |
const cors = require('cors') | |
const PORT = 1234 | |
const SECRET = 'mykey' | |
const app = express() | |
app.use(cors()) |
This file contains 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 main | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/jinzhu/gorm" | |
_ "github.com/mattn/go-sqlite3" | |
) | |
type Users struct { | |
Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"` |
This file contains 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 main | |
import ( | |
"database/sql" | |
"gopkg.in/gorp.v1" | |
"log" | |
"strconv" | |
"github.com/gin-gonic/gin" | |
_ "github.com/go-sql-driver/mysql" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Movies - Filter</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | |
</head> | |
<body class="container" style="margin-top: 1rem;"> |
This file contains 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 gulp = require('gulp'), | |
util = require('gulp-util'), | |
notifier = require('node-notifier'), | |
sync = require('gulp-sync')(gulp).sync, | |
reload = require('gulp-livereload'), | |
child = require('child_process'), | |
os = require('os'); | |
var server = null; |
This file contains 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 main | |
import ( | |
"fmt" | |
"math" | |
"sort" | |
) | |
type idSorter []article |
This file contains 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
// npm install express morgan jsonwebtoken cors | |
const express = require('express') | |
const morgan = require('morgan') | |
const jwt = require('jsonwebtoken') | |
const cors = require('cors') | |
const PORT = 1234 | |
const SECRET = 'mykey' | |
const app = express() |
This file contains 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
'title': 'This is my go blog' | |
'email': 'go@email.com' | |
'tags': [go, golang, yaml, json] |
NewerOlder