Skip to content

Instantly share code, notes, and snippets.

View caracal7's full-sized avatar

Dmitrii Vasilev caracal7

  • This planet
View GitHub Profile
@ilyar
ilyar / The_most_effective_attacks_against_web_applications.md
Last active April 30, 2023 13:23
Самые эффективные атаки на веб-приложения origin https://hackmd.io/7QGe2cu4QLeNU1Z87GQFMw?view

Самые эффективные атаки на веб-приложения

Ожидания от workshop'a

Общаемся 2 часа с перерывом на 15 минут
Моя задача рассказать об интересных атаках и объяснить как научиться их проводить
Первый час будет рассказ об атаках на веб приложения
Второй час будет демонстрацией практического применения атак
@Laslo89
Laslo89 / js_object_to_dot_notation
Last active February 24, 2020 19:36
some helpful helper functions regarding object manipulation, arrays and so on
// convert plain object to dot notation
// For example the following object:
/*
const obj = {
app: {
lang: {
menu: {
welcome: "welcome",
label: "label"
},
@codesections
codesections / actix-web.rs
Created December 20, 2018 22:03
Basic static file server with actix-web
extern crate actix_web;
use actix_web::{fs, server, App};
fn main() {
server::new(|| {
App::new()
.handler(
"/",
fs::StaticFiles::new("./public")
.unwrap()
@codesections
codesections / server.rs
Last active March 20, 2022 04:35
Naive static file server in rust
use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;
mod app;
fn main() {
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
for stream in listener.incoming() {
let stream = stream.unwrap();
handle_connection(stream);
@sketchpunk
sketchpunk / QuaterionSpring.js
Created November 17, 2018 06:07
Spring Physics - Oscillation and Critical Dampening on Quaternions
// Resources
// https://burakkanber.com/blog/physics-in-javascript-car-suspension-part-1-spring-mass-damper/
// https://gafferongames.com/post/spring_physics/
// https://gafferongames.com/post/physics_in_3d/
// http://digitalopus.ca/site/pd-controllers/
// .. Has things about Torque
class QuaterionSpring{
constructor( damping=5, stiffness=30 ){
this.velocity = new Float32Array(4);
@leonbobster
leonbobster / nested_sets.sql
Created July 14, 2018 15:15
The Nested Sets Model
CREATE TABLE nested_category (
category_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(20) NOT NULL,
lft INT NOT NULL,
rgt INT NOT NULL
);
INSERT INTO nested_category VALUES(1,'ELECTRONICS',1,20),(2,'TELEVISIONS',2,9),(3,'TUBE',3,4),
(4,'LCD',5,6),(5,'PLASMA',7,8),(6,'PORTABLE ELECTRONICS',10,19),(7,'MP3 PLAYERS',11,14),(8,'FLASH',12,13),
(9,'CD PLAYERS',15,16),(10,'2 WAY RADIOS',17,18);
@Andrew-Reid
Andrew-Reid / index.html
Last active October 9, 2022 11:10
Nested Enter/Update/Exit with id
<html>
<head>
<script src="https://d3js.org/d3.v4.js"></script>
</head>
<body>
<script>
// starter data:
var data = [
{id:0, children: d3.range(10)},
@antonagestam
antonagestam / draw_loop.js
Last active December 8, 2018 01:07
Asynchronous animation loop
/*
A slightly more condensed version of https://esdiscuss.org/topic/promises-async-functions-and-requestanimationframe-together
*/
let animation_frame = () => new Promise(window.requestAnimationFrame);
(async () => {
while (true) {
await animation_frame();
// draw
}
@axjs
axjs / xor.js
Created February 19, 2018 09:50
XOR crypt
const encrypt = (str, key) => str
.split('')
.map(s=>(s.charCodeAt()^key).toString(16))
.join('g')
;
const decrypt = (str, key) => str
.split('g')
.filter(Boolean)
.map(s=> String.fromCharCode(parseInt(s,16)^key) )
.join('')
// var diffSwap = require('myers-diff-array-swap')
var remove = require('remove-array-items')
var diff = require('myers-diff-array')
var assert = require('assert')
var morphNode = require('./lib/morph')
function Morph () {
this.results = []
this.swaps = []