Skip to content

Instantly share code, notes, and snippets.

View asci's full-sized avatar
🍊

Artem R asci

🍊
View GitHub Profile
var db = [];
var maxCount = 573;
var neibourghsCount = 50;
for (var i = 0; i < maxCount; i++) {
db[i] = {
name: 'user' + i,
id: i,
exp: Math.round(Math.random() * 10000),
points: Math.round(Math.random() * 100000)
<html><head><title>JBoss Web/7.0.13.Final - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: Servlet.init() for servlet spring th
/**
* Created with JetBrains WebStorm.
* User: artem
* Date: 10.01.13
* Time: 21:34
* To change this template use File | Settings | File Templates.
*/
var mysql = require('mysql'),
Promise = require("promise").Promise;
@asci
asci / gist:3775083
Created September 24, 2012 09:16
check
private function isProductSlotModelChangeKeyProperties(model:ProductionSlotModel):Boolean {
var index: int = getSlotViewIndexBySlotModel(_slots, model);
var slot:* = _slots[index];
var result:Boolean = false;
if (model.locked){
if (model.ready_for_open){
result = slot is SerialProductionSlotViewLockedReady;
if (!result) return true;
} else {
@asci
asci / modelseq.as
Created September 12, 2012 08:36
Сравнение моделей
// Если модели не равны — возвращается false
public static function isModelAndDataEquals(model:BaseModel, data:*):Boolean {
var res:Boolean,
i:int;
for (var prop:String in model) {
if (model.hasOwnProperty(prop)) {
if (data.hasOwnProperty(prop)) {
// Если модель
if (model[prop] is BaseModel) {
res = BaseModel.isModelAndDataEquals(model[prop], data[prop]);
@asci
asci / utest.js
Created August 9, 2012 14:04
Simple unit test
var code = function(num1, num2) {
// Сложная логика с предсказуемым результатом:
return num1 + num2;
}
var test = function (func, args, result) {
var res = func.apply(this, args);
if (res != result) {
console.log('FAIL, expected: ' + result + ', recieved ' + res);
} else {