Skip to content

Instantly share code, notes, and snippets.

@aw3s0me
aw3s0me / html_backbone.html
Last active August 29, 2015 14:01
HTML Backbone
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Martin Bean" />
<title>Twitter&rsquo;s Bootstrap with Ryan Fait&rsquo;s Sticky Footer</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<style>
html, body {
height: 100%;
# API authentication
from social.apps.django_app.utils import strategy
from rest_framework.authtoken.models import Token
from rest_framework.views import APIView
from rest_framework import parsers
from rest_framework import renderers
from rest_framework.authentication import get_authorization_header
from rest_framework.response import Response
@aw3s0me
aw3s0me / sessrest
Last active August 29, 2015 14:01
Django Rest Session Authentication
from rest_framework.authentication import SessionAuthentication
class SuperUserAuth(SessionAuthentication):
def authenticate(self, request):
request = request._request
user = getattr(request, 'username', None)
#if not user or not user.is_active or not user.is_superuser:
#return None
if not username:
@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) {
@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 / 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
http://ctf.gpn.entropia.de:50000/?user=')' // проблема в том, что сайт не дает поиск пользователя и нам надо сделать MySQL инъекцию, чтобы достать доступ к пользователю, для этого нужно эскейппоследовательность сделать и посмотреть какую ошибку даст MySQL.
Ответ: user='='
@aw3s0me
aw3s0me / 01.js
Last active August 29, 2015 14:06 — forked from martinaglv/01.js
function whatDoesItDo(val){
return val ? 1 : 2;
}
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 / 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
{