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
| #include <QUrl> | |
| #include <QtWebKitWidgets/QWebView> | |
| MainWindow::MainWindow(QWidget *parent) : | |
| QMainWindow(parent), | |
| ui(new Ui::MainWindow){ | |
| ui->setupUi(this); | |
| ui->webView->load(QUrl("http://www.google.com")); | |
| ui->webView->show(); |
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
| #ifndef MAINWINDOW_H | |
| #define MAINWINDOW_H | |
| #include <QMainWindow> | |
| #include <QUrl> | |
| #include <QWebFrame> | |
| #include <QWebElement> | |
| #include <QtWebKitWidgets/QWebView> | |
| #include <iostream> |
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
| #include "mainwindow.h" | |
| #include "ui_mainwindow.h" | |
| MainWindow::MainWindow(QWidget *parent) : | |
| QMainWindow(parent), | |
| ui(new Ui::MainWindow){ | |
| ui->setupUi(this); | |
| ui->webView->load(QUrl("http://www.google.com")); | |
| ui->webView->show(); |
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
| #include <stdio.h> | |
| int main(){ | |
| unsigned int size = 12; | |
| char str[] = "Hello, Worms!"; | |
| char temp; | |
| int i = 0; | |
| for( i = 0; i < size/2; i++ ){ |
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 codify | |
| import ( | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "math/rand" | |
| ) | |
| type Salting_Struct struct { |
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
| // Users username and password, outputs password + salt | |
| func Password(user string, pass string) string { | |
| var password []byte | |
| var username []byte | |
| // Converts username to bytes | |
| username = []byte("user:" + user + pass) | |
| // Dial up a mongoDB session |
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
| // Generates a salt for the given user | |
| func GenerateSalt(user string, pass string) string { | |
| var password []byte | |
| var username []byte | |
| username = []byte("user:" + user + pass) | |
| // Dial up a mongoDB session | |
| session, _ := mgo.Dial("127.0.0.1:27017/") |
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
| type Inventory struct { | |
| Material string | |
| Count uint | |
| } | |
| sweaters := Inventory{"wool", 17} | |
| tmpl, _ := template.New("test").Parse("{{.Count}} items are made of {{.Material}}") | |
| tmpl.Execute(os.Stdout, sweaters) |
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
| <head> | |
| <div>{{.UserData}}</div> | |
| <h1>{{.Title}}</h1> | |
| </head> | |
| <sidebar> | |
| {{.Bar}} | |
| </sidebar> | |
| <body> | |
| {{.Body}} | |
| </body> |
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
| type Page struct { | |
| Title string | |
| Body template.HTML | |
| UserData template.HTML | |
| Bar template.HTML | |
| } | |
| // Loads a page for use | |
| func loadPage(title string, r *http.Request) (*Page, error) { |