Skip to content

Instantly share code, notes, and snippets.

View lettergram's full-sized avatar
🕶️
Loading...

Austin Walters lettergram

🕶️
Loading...
View GitHub Profile
#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();
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QUrl>
#include <QWebFrame>
#include <QWebElement>
#include <QtWebKitWidgets/QWebView>
#include <iostream>
#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();
#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++ ){
package codify
import (
"crypto/sha256"
"encoding/hex"
"math/rand"
)
type Salting_Struct struct {
// 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
// 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/")
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)
<head>
<div>{{.UserData}}</div>
<h1>{{.Title}}</h1>
</head>
<sidebar>
{{.Bar}}
</sidebar>
<body>
{{.Body}}
</body>
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) {