Skip to content

Instantly share code, notes, and snippets.

View ddavaham's full-sized avatar
🎯
Focusing

David Davaham ddavaham

🎯
Focusing
View GitHub Profile
CREATE TABLE `types` (
`id` INT(10) UNSIGNED NOT NULL,
`name` VARCHAR(255) NOT NULL COLLATE 'utf8_unicode_ci',
`description` TEXT NULL COLLATE 'utf8_unicode_ci',
`published` TINYINT(1) NOT NULL DEFAULT '0',
`group_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`market_group_id` INT(10) UNSIGNED NULL DEFAULT NULL,
`volume` DOUBLE(12,4) NOT NULL DEFAULT '0.0000',
`price` DOUBLE(15,4) NOT NULL,
`packaged_volume` DOUBLE(13,4) NULL DEFAULT NULL,
<?php
namespace SUN\Models\ESI;
use Illuminate\Database\Eloquent\Model;
class Type extends Model
{
...
public function skillz()
foreach ($killmails as $killId=>$kill) {
$bpk = 0;
if ($adjustments->has('character')) {
if ($adjustments->get('character')->has($kill->character_id)) {
$bpk += $adjustments->get('character')->get($kill->character_id);
}
}
if ($adjustments->has('corporation')) {
if ($adjustments->get('corporation')->has($kill->corporation_id)) {
<?php
namespace SUN\Models\ESI;
use Illuminate\Database\Eloquent\Model;
use SUN\Models\{Member, AccessList};
use SUN\Models\SDE\{Ancestry, Bloodline, Race};
class Character extends Model
<?php
namespace SUN\Models\ESI;
use Illuminate\Database\Eloquent\Model;
use SUN\Models\{AccessList,CorporationWallet,Member,MailRecipient};
class Corporation extends Model
{
<?php
namespace SUN\Models;
use SUN\Traits\HasPermissionsTrait;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use SUN\Models\ESI\{Character, Contract, MailHeader, MailingList, Station, Structure, Type};
$tidy = tidy_parse_string($testString, [
'doctype' => "omit",
'show-body-only' => true
]);
$dom->loadHtml($tidy->value, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
foreach ($dom->getElementsByTagName('font') as $anchor) {
if ($anchor->hasAttribute('size')) {
$anchor->removeAttribute('size');
}
if ($anchor->hasAttribute('color')) {
// remove font size
$formattedMessage = preg_replace('/size="[^"]*[^"]"/', "", $reponse->body);
// remove wrong color
$formattedMessage = preg_replace('/(color="#)[a-f0-9]{2}([a-f0-9]{6}")/', '', $formattedMessage);
// link to kms
$formattedMessage = preg_replace('/<a href="killReport:(\d+):(\w+)">/', '<a href="' . config('base.kmUrl') . 'kill/\1/" target="_blank">', $formattedMessage);
// link fits
$formattedMessage = preg_replace('/<a href="fitting:([\d:;]+)">/', '<a href="' . config('base.osmiumUrl') . 'loadout/dna/\1" target="_blank">', $formattedMessage);
// link system/station
$formattedMessage = preg_replace('/<a href="showinfo:(?:5|3867)\/\/(\d+)">/', '<a href="' . config('base.dotlanUrl') . 'search?q=\1">', $formattedMessage);
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->