Skip to content

Instantly share code, notes, and snippets.

View Goddard's full-sized avatar
🎰
Coding

Ryein Goddard Goddard

🎰
Coding
View GitHub Profile
void ImageView::paintEvent(QPaintEvent*)
{
if (this->imageBuffer.empty()){ return; }
double widgetWidth = this->width();
double widgetHeight = this->height();
QRectF target(0, 0, widgetWidth, widgetHeight);
QImage tempQImage = *this->imageBuffer.at(this->imageBuffer.count()-1);
tempQImage = tempQImage.scaled(rect().size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
@Goddard
Goddard / form.php
Created July 12, 2014 00:34
semi-fixed form.php file from ohana
<? (defined('_JEXEC') && defined('KOOWA')) or die('Restricted access'); ?>
<style src="media://com_ohanah/lib/cleditor/jquery.cleditor.css" />
<style src="media://com_ohanah/css/jquery-ui.css" />
<style>
.authorInfo {
overflow: hidden;
}
.debug {
color: #555;
margin: 20px;
@Goddard
Goddard / install-node-npm-ubuntu-raring.sh
Created May 2, 2013 04:32 — forked from stephanetimmermans/gist:5496788
Install Node Js and NPM in Ubuntu 13.04
sudo apt-get install build-essential libssl-dev curl
# The install script
# Adapted from https://gist.github.com/579814
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc
. ~/.bashrc
import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
/**
*
* @author goddard
*/
public class XMLReader
@Goddard
Goddard / Findgl.cmake
Created March 22, 2012 06:58
This is the gl cmake module
INCLUDE (FindPackageHandleStandardArgs)
FIND_PACKAGE(PkgConfig ${gl_FIND_REQUIRED} ${gl_FIND_QUIETLY})
IF (PKG_CONFIG_FOUND)
SET(PKG_CONFIG_PATH_ENV_VAR $ENV{PKG_CONFIG_PATH})
IF (NOT PKG_CONFIG_PATH_ENV_VAR)
IF (gl_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Environment variable PKG_CONFIG_PATH not set. Setting this variable is required in order for pkg-config to locate installed software packages.")
ENDIF (gl_FIND_REQUIRED)
ENDIF (NOT PKG_CONFIG_PATH_ENV_VAR)
PKG_CHECK_MODULES (gl gl)
SELECT TotalAmount
FROM INVOICE
WHERE TotalAmount > 100.00 AND CustomerNumber =
(
SELECT FirstName, LastName
FROM CUSTOMER
WHERE CustomerID = CustomerNumber
)
$sql3 = "INSERT INTO vault (username, displayname, password, passwordmd5, email, creationdate, ip)VALUES(?, ?, ?, ?, ?, ?, ?)";
$query3 = $DB->prepare($sql1) or trigger_error($lang_error['INSERT_ERROR'], E_USER_ERROR);
$query3->execute(array($username, $codename, $password, $passwordmd5, $email, $date_time, $ip));
$sql2 = "UPDATE users SET logintime=?, iplog = CONCAT(iplog, ?) WHERE id=? AND iplog NOT LIKE ?";
$query2 = $DB->prepare($sql2);
$query2->execute(array($date_time, $ip ."':'", $id, "'%'". $ip ."'%'"));
/**
* Description of the class or document.
*
* @author Ryein C. Bowling
* @version CS162 Lab 9, 5.28.2010
*/
import java.io.*;
import java.util.*;