Skip to content

Instantly share code, notes, and snippets.

Denis Kreshikhin kreshikhin

  • Ryazan, Russia
Block or report user

Report or block kreshikhin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gcm diff
const gcm = require('node-aes-gcm')
const key = new Buffer([0xfe,0xff,0xe9,0x92,0x86,0x65,0x73,0x1c,0x6d,0x6a,0x8f,0x94,0x67,0x30,0x83,0x08])
const iv = new Buffer([0xca,0xfe,0xba,0xbe,0xfa,0xce,0xdb,0xad,0xde,0xca,0xf8,0x88])
const plaintext1 = `
quicksort [] = []
quicksort (x:xs) = quicksort small ++ (x : quicksort large)
where small = [y | y <- xs, y <= x]
large = [y | y <- xs, y > x]
@kreshikhin
kreshikhin / stack.swift
Created Aug 2, 2017 — forked from gazolla/stack.swift
Programmatically create UIStackView
View stack.swift
lazy var v1:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v
}()
lazy var v2:UIView = {
let v = UIView()
v.backgroundColor = .blueColor()
return v
View .gitignore
# Xcode
#
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
View gist:d88b480efb1315303bc64d63a862752e
<key>Patches</key>
<array>
<dict>
<key>Comment</key>
<string>Rename HDAS to HDEF</string>
<key>Find</key>
<data>
SERBUw==
</data>
<key>Replace</key>
View test_route.js
router.get('/gps/loc*', function(req, res) {
var data = {
user_id: req.query.user_id,
lat: req.query.lat,
lon: req.query.lon,
timestamp: req.query.timestamp,
hdop: req.query.hdop,
altitude: req.query.altitude,
speed: req.query.speed
};
View toster_rect.js
function rescale(rect, border){
var a = rect[0], b = rect[1], c = rect[2], d = rect[3];
var ab = {x: b.x - a.x, y: b.y - a.y};
var ad = {x: d.x - a.x, y: d.y - a.y};
var lab = Math.sqrt(ab.x*ab.x+ab.y*ab.y);
var lad = Math.sqrt(ad.x*ad.x+ad.y*ad.y);
var ab1 = {x: ab.x * (lab + border) / lab, y: ab.y * (lab + border) / lab};
var ad1 = {x: ad.x * (lad + border) / lad, y: ad.y * (lad + border) / lad};
View toster_dynamic_cast_example.cpp
#include <vector>
#include <iostream>
class Fruit{
public:
std::string variety;
public:
std::string virtual GetVariety() { return variety; };
};
@kreshikhin
kreshikhin / agents.md
Created Nov 9, 2015 — forked from Paratron/agents.md
Social Network Crawler User Agents
View agents.md

#Social Network Crawler User Agents Users can post URLs on a lot of different platforms nowadays. Most of those platforms will send a request to that URL to generate some preview data from it.

These are a couple of user agents I quickly tested out.

##Facebook

facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
@kreshikhin
kreshikhin / add-ssh-to-remote-server.sh
Created Aug 3, 2015
This code adds ssh key to remtoe server
View add-ssh-to-remote-server.sh
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
View httptest.c
/* http-client.c
*
* Copyright (c) 2000 Sean Walton and Macmillan Publishers. Use may be in
* whole or in part in accordance to the General Public License (GPL).
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
You can’t perform that action at this time.