Skip to content

Instantly share code, notes, and snippets.

View dyatlov's full-sized avatar

Vitali Deatlov dyatlov

View GitHub Profile
mktoresp.com
marketo.com
*.gitlab.com
codepen.io
*.embedly.com
medium.com
*.linkedin.com
cdn.syndication.twimg.com
disqus.com
slideshare.net
package main
import (
"fmt"
"time"
"sync"
)
type payloadData struct {
Index int
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bitset>
using namespace std;
int main() {
@dyatlov
dyatlov / json_arch.js
Created June 23, 2016 11:13
Save json objects compactly in memory. Save just unique key names and values
'use strict';
class JsonArch
{
constructor(){
this.storage = {keys: [], values: {}};
this.objs = [];
}
add_recursive(obj, storage){
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
DIR=/var/app/current
if [ "$WORKER_MODE" = "1" ]
then
if [ -f /var/run/shoryuken.pid ]
then
su -l -c "kill -USR1 `cat /var/run/shoryuken.pid`" root || echo "no process"
su -l -c "rm -f /var/run/shoryuken.pid" root || echo "no file"
fi
@dyatlov
dyatlov / modal.js.jsx.coffee
Last active November 7, 2016 19:10
ReactJs + Zurb Foundation modal example. Allows inner modals too
@Modal = React.createClass
propTypes:
id: React.PropTypes.string
show: React.PropTypes.bool
getInitialState: ->
show: false
getDefaultProps: ->
id: 'generic-modal-popup'
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.3)
@dyatlov
dyatlov / hb-test.py
Last active September 22, 2024 01:05
OpenSSL heartbeat PoC with STARTTLS support - Python3 version
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
import re
import codecs