Skip to content

Instantly share code, notes, and snippets.

View bazilio91's full-sized avatar

Vasily Ostanin bazilio91

  • Tbilisi, Georgia
View GitHub Profile
@bazilio91
bazilio91 / structures.json
Last active March 9, 2021 23:29
ESI non-public public structures
[
{
"ID": 1031299789028,
"Name": "Tash-Murkon Prime - 2% Resrch-Invntion \u0026 Manfacting",
"SolarSystemId": 30001671,
"TypeId": 35826,
"RegionId": 0,
"Public": false
},
{
@bazilio91
bazilio91 / mqtt-led
Created April 22, 2015 04:02
arduino mqtt led stripe
#include <PubSubClient.h>
#include <SPI.h>
#include <Ethernet.h>
// don't futz with these, illicit sums later
#define RED 7// pin for red LED
#define GREEN 8 // pin for green - never explicitly referenced
#define BLUE 2 // pin for blue - never explicitly referenced
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
local redis = require 'redis'
local host = "127.0.0.1"
local port = 6379
client = redis.connect(host, port)
redis.call = function(cmd, ...)
return assert(loadstring('return client:' .. string.lower(cmd) .. '(...)'))(...)
end
@bazilio91
bazilio91 / CachingRegion.js
Created February 11, 2014 09:35
Caching Region for Marionette.js
define(['marionette', 'underscore'], function (Marionette, _) {
/**
* @class CachingRegion
*/
return Marionette.Region.extend({
show: function (view) {
this.ensureEl();
this.currentView = view;
if (!_.isUndefined(view.cached)) {
@bazilio91
bazilio91 / DnD-emulate
Last active January 1, 2016 07:29
Creates (or emulates) drag & drop event
/**
* Creates (or emulates) drag & drop event
* @param type event type
* @param options event options
* @param transferData data attached to event transfer
* @returns {*}
*
* Usage:
* var event = createDragEvent('drop'); // or dragend, or dragstart, etc.
* // feel free to use event.dataTransfer.setData('key', value);
#!/usr/bin/env python
import sys, MySQLdb, time
from pywws import WeatherStation
CLASS_ID = 20
OBJECT_TITLE = u'ws'
ws = WeatherStation.weather_station()
@bazilio91
bazilio91 / php-switch
Last active October 4, 2016 19:31
Homebrew php & php-fpm fast switch
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php54 --with-fpm && brew install php55 --with-fpm
# Note:
# error_log = /usr/local/var/log/php-fpm.log
# and
# daemonize = yes
# must be in php-fpm.conf
@bazilio91
bazilio91 / editThisPage.js
Last active December 11, 2015 23:18
edit this page bookmark
javascript:(function(){
var text = document.documentElement.outerHTML;
var id = 'letsRockAndPiuPiuPiu';
var script = document.createElement('script');
script.src='//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';
document.body.appendChild(script);
script.onload = function(){
document.body.removeChild(document.body.lastChild);
@bazilio91
bazilio91 / gist:3910116
Created October 18, 2012 06:00
PhpUnit image assert function
protected function assertImage($expected, $actual, $message = '')
{
$descriptors = array(
array('pipe', 'r'),
array('pipe', 'w'),
array('pipe', 'w'),
);
$command = 'compare -metric RMSE ' . escapeshellarg($expected) . ' ' . escapeshellarg($actual) . ' /dev/null';
$proc = proc_open($command, $descriptors, $pipes);
@bazilio91
bazilio91 / gist:3825111
Created October 3, 2012 05:03
weather status 2 icon
const WEATHER_ICON_CLEAR = 0; // ясно
const WEATHER_ICON_PARTY_CLOUDY = 1; // переменная облачность
const WEATHER_ICON_STRONG_CLOUDY = 2; // облачно
const WEATHER_ICON_CLOUDY = 3; // пасмурно
const WEATHER_ICON_LIGHT_RAIN = 4; // дождь
const WEATHER_ICON_RAIN = 5; // ливень
const WEATHER_ICON_SNOW = 6; // снег
const WEATHER_ICON_RAIN_AND_SNOW = 7; // снег с дождем
const WEATHER_ICON_THUNDER = 8; // гроза
const WEATHER_ICON_CASTLE = 9; // град