Skip to content

Instantly share code, notes, and snippets.

View fuzzysteve's full-sized avatar
💭
Building shit

Steve Anderson / Steve Ronuken fuzzysteve

💭
Building shit
View GitHub Profile
@fuzzysteve
fuzzysteve / decryptorEffects
Created July 28, 2014 03:06
Decryptor effects by blueprint
SELECT it2.typename,
it2.typeid,
coalesce(dta2.valueInt,dta2.valueFloat) multiplier,
coalesce(dta3.valueInt,dta3.valueFloat) me,
coalesce(dta4.valueInt,dta4.valueFloat) te,
coalesce(dta5.valueInt,dta5.valueFloat) runs
FROM invTypes
JOIN industryActivityMaterials iam ON (iam.materialtypeid=invTypes.typeid and iam.activityid=8 and groupid=716)
JOIN industryActivityProducts iap ON (iam.typeid=iap.typeid)
JOIN dgmTypeAttributes dta on (dta.typeid=invTypes.typeid and dta.attributeID=1115)
<?php
$ch = curl_init();
$url="http://public-crest-sisi.testeveonline.com/industry/systems/";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
if ($result===false) {
@fuzzysteve
fuzzysteve / gist:10647593
Last active August 14, 2017 23:48
skill levels - Eve online
Style 1 : 1 row per type. multiple skills in each row.
select typeid, max(skill1) skill1,max(skill1level) skill1level,max(skill2) skill2,max(skill2level) skill2level,max(skill3) skill3,max(skill3level) skill3level,max(skill4) skill4,max(skill4level) skill4level,max(skill5) skill5,max(skill5level) skill5level,max(skill6) skill6,max(skill6level) skill6level from
(
select typeid,coalesce(valueint,valuefloat,0) skill1,0 skill1level,0 skill2,0 skill2level,0 skill3,0 skill3level,0 skill4,0 skill4level,0 skill5,0 skill5level,0 skill6,0 skill6level from dgmTypeAttributes where attributeID=182
union
select typeid,0 skill1,0 skill1level,coalesce(valueint,valuefloat,0) skill2,0 skill2level,0 skill3,0 skill3level,0 skill4,0 skill4level,0 skill5,0 skill5level,0 skill6,0 skill6level from dgmTypeAttributes where attributeID=183
union
select typeid,0 skill1,0 skill1level,0 skill2,0 skill2level,coalesce(valueint,valuefloat,0) skill3,0 skill3level,0 skill4,0 skill4level,0 skill5,0 skill5level,0 skill6,0 skill6level from
@fuzzysteve
fuzzysteve / gist:9695750
Created March 21, 2014 20:33
Refinery levels by security status.
+------------------------+----------+----------+
| reprocessingEfficiency | count(*) | Security |
+------------------------+----------+----------+
| 0.5 | 2708 | high |
| 0.4 | 1 | high |
| 0.35 | 26 | high |
| 0.32 | 95 | high |
| 0.3 | 155 | high |
| 0.25 | 10 | high |
| 0.5 | 1476 | low |
@fuzzysteve
fuzzysteve / gist:8708591
Last active August 29, 2015 13:55
SQL for trait display
select coalesce(typename,'Role Bonus') name,bonusText,
coalesce(if(invTraits.unitid=139,bonus,concat(bonus,displayName)),'') bonus
from invTraits
left join invTypes on (invTraits.skillid=invTypes.typeid)
left join eveUnits on (eveUnits.unitID=invTraits.unitID)
where invTraits.typeid=:id
requires:
https://www.fuzzwork.co.uk/dump/rubicon-1.1-94321/invTraits.sql.bz2
@fuzzysteve
fuzzysteve / gist:8382425
Created January 12, 2014 08:53
implant sets.
2082 1 Christmas
2589 1 Christmas
33393 1 Christmas
33394 1 Christmas
19534 2 Talisman
19535 2 Talisman
19536 2 Talisman
19537 2 Talisman
19538 2 Talisman
19539 2 Talisman
#!/usr/bin/perl
use warnings;
use strict;
use JSON;
use Compress::Zlib;
use List::Util qw[min max];
use ZMQ::LibZMQ3;
use ZMQ::Constants qw/ZMQ_SUB ZMQ_SUBSCRIBE/;
$|=1;
@fuzzysteve
fuzzysteve / gist:7914509
Last active December 31, 2015 01:29
Generate how many stars are within 4.3ly of each system in kspace. (hence the -0.99 restriction)
select solarsystemid,sum(local) from (select mss1.solarsystemid,if(sqrt(pow(mss1.x-mss2.x,2)+pow(mss1.y-mss2.y,2)+pow(mss1.z-mss2.z,2))<4.06802721e16,1,0) local from mapSolarSystems mss1 join mapSolarSystems mss2 on (mss1.solarsystemid != mss2.solarsystemid) where mss1.security!=-0.99 and mss2.security!=-0.99) it group by solarsystemid
@fuzzysteve
fuzzysteve / assetloader
Created December 11, 2013 02:51
A little something to load assets into a DB
<?php
require_once('db.inc.php');
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "$url");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($curl);
$xml = new simpleXMLElement ($content);
@fuzzysteve
fuzzysteve / certloader.php
Last active December 28, 2015 23:59
Initial schema for certificate information Certificate levels run 0 to 4, to match the mastery levels.
<?
require_once("db.inc.php");
$certificates=yaml_parse_file("certificates.yaml");
$certsql="insert into evesupport.certificates (certificateID,description,groupid,name) values (:certid,:description,:groupid,:name)";