Skip to content

Instantly share code, notes, and snippets.

View bityob's full-sized avatar

Yonatan Bitton bityob

View GitHub Profile
@bityob
bityob / dnx-installation.txt
Last active September 7, 2016 18:07
How to use and install DNX on VS 2015 Update 2?
1. First install VS update 2
* Download the .iso file
* Uncheck the "Update 3" option
2. How to use ASP.NET 5 Template?
* Use an existing project of ASP.NET 5 as template
(maybe there is another approach or maybe it's no longer an issue after successfully installed the DNX package)
3. How to install the DNX itself?
* In VS, in the Package Manager windows enter: Install-Package dnx-clr-win-x64 -Version 1.0.0-rc1-update1 -Pre
@bityob
bityob / Output_example.txt
Last active January 8, 2017 22:13
Print http conversation from pcap file using Scapy
GET / HTTP/1.1
Host: ifconfig.co
User-Agent: curl/7.47.0
Accept: */*
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 08 Jan 2017 20:01:11 GMT
Content-Type: text/plain; charset=utf-8
@bityob
bityob / XmlWithoutDeclaration.cs
Last active May 5, 2017 05:29
Using XmlWriter to write xml without declaration
using System.Xml;
namespace XmlTools
{
class XmlWithoutDeclaration
{
static void Main(string[] args)
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
@bityob
bityob / Links.md
Last active May 24, 2017 18:07
Tile Servers Links
@bityob
bityob / pocket_move_all_list_to_archive.py
Created July 6, 2017 22:52
Move all list to archive (Pocket)
# https://pypi.python.org/pypi/pocket-api/
from pocket import Pocket, PocketException
from sys import exit
# see link above, how to set key and token
key = ""
token = ""
p = Pocket(key, token)
print("Connected")
@bityob
bityob / nuget_getter.py
Created July 19, 2017 05:19
Download nuget packages with all dependencies recursively
# -*- coding: utf-8 -*-
import scrapy
import os
urls = {}
class NugetSpider(scrapy.Spider):
global urls
name = 'nuget'
allowed_domains = ['nuget.org']
@bityob
bityob / find_union_algo.py
Last active July 19, 2017 15:22
find_union_algo created by bityob - https://repl.it/J8x7/7
indata = """1 2
3 4
5 6
7 8
7 9
2 8
0 6
1 9"""
data = [x.split() for x in indata.splitlines()]
L.AnimatedMarker = L.Marker.extend({
options: {
// meters
distance: 200,
// ms
interval: 1000,
// animate on add?
autoStart: true,
// callback onend
onEnd: function(){},
@bityob
bityob / DictWithMaxKeys.py
Created December 25, 2017 19:09
Dictionary with maximun length, keep last N keys on dictionary, using deque object
from collections import deque
class DictWithMaxKeys:
def __init__(self, maxlen, init=None):
self.maxlen = maxlen
self._deque = deque()
self._dict = {}
if init is not None:
self._dict.update(init)
@bityob
bityob / DictWithMaxKeys.cs
Last active December 25, 2017 20:25
Dictionary with maximun length, keep last N keys on dictionary, using Queue object (C#)
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace DictMaxLength
{