Skip to content

Instantly share code, notes, and snippets.

View flexd's full-sized avatar

Kristoffer Berdal flexd

  • Oslo, Norway
  • 09:33 (UTC +02:00)
View GitHub Profile
require "cinch/storage"
require "redis"
require "json"
module Cinch
class Storage
class Redis < Storage
def initialize(options, plugin)
# New Redis object, thread safe by default since 2.2.0
@redis = ::Redis.new(:host => 'localhost', :port => 6379)
#!/usr/bin/env ruby
require 'cinch'
require 'cinch/storage/redis'
class Memo
class MemoStruct < Struct.new(:user, :channel, :text, :time)
def to_s
"[#{time.asctime}] <#{channel}/#{user}> #{text}"
end
<html>
<head></head>
<body>
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til db");
mysql_select_db("kristoffer") or die("Kan ikke koble til");
?>
<table width="50%" border="1"><tr><td>Navn</td><td>Alder</td></tr>
<?php
$sql= "select * from person" ;
<html>
<head></head>
<body>
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til db");
mysql_select_db("kristoffer") or die("Kan ikke koble til");
?>
<table width="50%" border="1"><tr><td>Navn</td><td>Alder</td></tr>
<?php
$sql= "select * from person" ;
<html>
<head></head>
<body>
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til db");
mysql_select_db("kristoffer") or die("Kan ikke koble til");
?>
<table width="50%" border="1"><tr><td>ENAME</td><td>JOB</td><td>DEPT</td><td>LOC</td></tr>
<?php
$sql= "select ENAME, JOB, DNAME, LOC from EMP AS E, DEPT AS D WHERE E.DEPTNO = D.DEPTNO";
<html>
<head></head>
<body>
<form name="form1" method="post" action="legginnavd.php">
<table width="100%" border="0">
<tr>
<td>DEPT NO:</td>
<td><input type="text" name="DEPTNO"></td>
</tr>
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til server");
mysql_select_db("kristoffer")or die("Kan ikke koble til databasen");
$deptno=trim($_POST ["DEPTNO"]);
$dname=trim($_POST ["DNAME"]);
$loc=trim($_POST ["LOC"]);
$sql="INSERT INTO DEPT (DEPTNO, DNAME, LOC) VALUES ('$deptno','$dname','$loc')";
$resultat=mysql_query($sql);
header("Location:meny.html");
<html>
<head></head>
<body>
<h1>Meny</h1>
<a href="listansatte.php">List ansatte</a>
<p>
<a href="avdskjema.html">Legg til avdeling</a>
</body>
</html
/*
*/
package org.cognitive;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.opengl.Texture;
@Override
public void draw() {
this.sprite.getTexture().bind();
int tileSize = ScrollGame.tManager.sheets.get(0).getTileSize();
double row = this.sprite.getsY();
double col = this.sprite.getsX();
double v0 = tileSize * row * (1/this.height);
double v1 = tileSize * (row + 1) * (1/this.height);