Skip to content

Instantly share code, notes, and snippets.

{"1263735095": {"userName": "alex", "comment": "fef", "review:isMajor": true, "userAvatar": "/static/img/default_avatar.png", "user": 2, "date": 1454491076160, "id": 1263735095}, "2281243457": {"userName": "reviewer1", "comment": "Reviewer1", "isMajor": false, "userAvatar": "/static/img/default_avatar.png", "user": 7, "date": 1453463957590, "id": 2281243457}, "2109250291": {"userName": "reader1", "comment": "Reader1", "isMajor": false, "userAvatar": "/static/img/default_avatar.png", "user": 3, "date": 1453463924849, "id": 2109250291}, "1600459977": {"userName": "alex", "comment": "", "review:isMajor": false, "userAvatar": "/static/img/default_avatar.png", "user": 2, "date": 1454491061400, "id": 1600459977}, "3994840298": {"userName": "reader2", "comment": "Reader2", "isMajor": false, "userAvatar": "/static/img/default_avatar.png", "user": 4, "date": 1453463935016, "id": 3994840298}, "1471743182": {"userName": "author1", "comment": "Author1", "isMajor": false, "userAvatar": "/static/img/default_avatar.png", "u
@aw3s0me
aw3s0me / weibull.py
Created November 22, 2015 22:25 — forked from plasmaman/weibull.py
Python code for estimating the shape and scale parameters for a two-parameter Weibull distribution. It uses scipy.optimize.fmin to minimize the Likelihood function.
from scipy.stats import exponweib
from scipy.optimize import fmin
import numpy as np
# x is your data array
# returns [shape, scale]
def fitweibull(x):
def optfun(theta):
return -np.sum(np.log(exponweib.pdf(x, 1, theta[0], scale = theta[1], loc = 0)))
@aw3s0me
aw3s0me / builddt.cs
Created August 4, 2015 11:37
Build datatemplate in code behind
//create the data template
DataTemplate cardLayout = new DataTemplate();
cardLayout.DataType = typeof(CreditCardPayment);
//set up the stack panel
FrameworkElementFactory spFactory = new FrameworkElementFactory(typeof(StackPanel));
spFactory.Name = "myComboFactory";
spFactory.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);
//set up the card holder textblock
@aw3s0me
aw3s0me / json orm int
Created June 21, 2015 14:00
json orm int
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace jsonorm
{
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
@aw3s0me
aw3s0me / 01.js
Last active August 29, 2015 14:06 — forked from martinaglv/01.js
function whatDoesItDo(val){
return val ? 1 : 2;
}
http://ctf.gpn.entropia.de:50000/?user=')' // проблема в том, что сайт не дает поиск пользователя и нам надо сделать MySQL инъекцию, чтобы достать доступ к пользователю, для этого нужно эскейппоследовательность сделать и посмотреть какую ошибку даст MySQL.
Ответ: user='='
@aw3s0me
aw3s0me / adei.login.php
Created June 13, 2014 07:58
adei.login.php
//1) Made changeds to menu.php (added xml element "Login" to item_tag)
//2) menu.js added function to run it in eval. Login()
//3) Installed php library HybridAuth. /adei/includes/hybridauth-2.1.2/install.php
@aw3s0me
aw3s0me / rjsuglify.css
Last active August 29, 2015 14:02
Uglify css with requirejs
http://stackoverflow.com/questions/16901246/how-to-minify-css-files-with-requirejs
#1. Create a style.css file and @import all your other css's into this file.
@import url("css/firstfile.css");
@import url("css/secondfile.css");
#2. Create a build.js file as follows:
@aw3s0me
aw3s0me / katrin_val.js
Created June 11, 2014 13:41
adei_katrin_value_calc
jQuery('.field').each(function(i) {
var id = parseInt($(this).attr('id'));
var value = response.data[id].Value;
var floatvalue = parseFloat(response.data[id].RawValue);
var intvalue = parseInt(response.data[id].RawValue);
if ((id >= 2) && (id <= 9)) {
if (floatvalue > 849.5) {
value = "OPEN";
}
else if (floatvalue < -199.5) {