Skip to content

Instantly share code, notes, and snippets.

View tchalvak's full-sized avatar
🐙
making another SPA

Roy R. tchalvak

🐙
making another SPA
View GitHub Profile
@tchalvak
tchalvak / SRA install steps
Created February 11, 2012 05:13
Install steps for SRA.
Install Steps
-------------
Download codeigniter (CodeIgniter_2.1.0 currently) zip, just google it.
Unzip codeigniter somewhere, and steal the contents of the /system/ folder within it. Copy everything in /system/*, and paste those folders into SRA's /system/ folder to form the running core of codeigniter for SRA.
(Only the /system/libraries/Zend folder need be retained)
Create Database:
createdb sra;
createlang plpgsql sra;
@tchalvak
tchalvak / inline_template_test.php
Created September 7, 2011 22:19
PHP inline templating craziness.
<?php
// System for using simple, native php templates.
// TODO: Put this in a namespace to keep it clean and seperate.
function display_page_inline($templates, $options, $data){
$title = @$options['title'];
echo "<html><head><title>".htmlentities($title)."</title></head>";
if(is_array($templates)){
@tchalvak
tchalvak / Bcrypt.php
Created August 17, 2011 16:17
Simple PHP 5.3+ Bcrypt functions
<?php
// ================================================================================================================
// Bcrypt hashing and hash checking wrapper functions for simplified, secure password encryption
// ================================================================================================================
// Create a bcrypt_hash.
function bcrypt_hash($password, $work_factor = 8)
{
@tchalvak
tchalvak / Bcrypt.php
Created August 5, 2011 17:26
Simple PHP 5.3+ Bcrypt class and functions
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form:
tchalvak:~/ninjawars/deploy$ cat lib/common/lib_input.php
<?php
/*
* Deals with getting and filtering user input (just from request).
*
* @package input
*/
// Input function that by default LEAVES INPUT COMPLETELY UNFILTERED
// To not filter some input, you have to explicitly pass in null for the third parameter,
#!/bin/sh
cd ~/bin
curl -O http://github.com/technomancy/leiningen/raw/stable/bin/lein
chmod 755 lein
lein self-install
cd /tmp
mkdir garden
cd garden/
cat >project.clj <<EOF
diff --git a/deploy/lib/char/Player.class.php b/deploy/lib/char/Player.class.php
index 81f04fe..277c3d8 100644
--- a/deploy/lib/char/Player.class.php
+++ b/deploy/lib/char/Player.class.php
@@ -61,5 +61,9 @@ class Player
public function as_array() {
return (array) $this->vo;
}
+
+ public function get_player_id() {
Experience System Goals:
Disincentivize spamming by rewarding risk
(i.e. winning against a single strong target should be more rewarding than winning against the equivalent hp of many weak targets)
(and actually taking damage should be more rewarding than taking no damage)
Reward tactics, better damage with the same tools, more than spamming.
(e.g. rewards for a kill instead of just a hit and run)
(and more experience for damage done)
(and eventually additive use of effects like poison)
Reward difficulty
@tchalvak
tchalvak / gist:233163
Created November 12, 2009 18:47
Gallery2 include names.
public $includes = array(
"list" => array(
"desc" => "List of images and image detail"),
"toplevel" => array(
"desc" => "List of top-level categories only",
"fixed" => array(
"action" => "toplevel")),
"nestedlevels" => array(
"desc" => "List of all category depths",
"default" => array(
<?php
} else if ($victom == "Thief") { // You only get ganged up on by the thieves if you're already trying to attack the theif.
// Check the counter to see whether they've attacked a thief multiple times in a row.
if(SESSION::get('counter')){
$counter = SESSION::get('counter');
} else {
$counter = 1;
}
$counter = $counter + 1;