Skip to content

Instantly share code, notes, and snippets.

@alexin-ivan
alexin-ivan / tun-ping-linux.py
Created March 15, 2017 12:09 — forked from shawnlower/tun-ping-linux.py
Reading/writing Linux's TUN/TAP device using Python.
#!/usr/bin/python3
import fcntl
import os
import struct
import subprocess
import time
from array import array
@alexin-ivan
alexin-ivan / Box.hs
Created May 7, 2014 08:15
Box for matrix
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Box where
import CLaSH.Prelude
import qualified Data.Foldable as F
-- Automatically generated VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use work.all;
use work.types.all;
entity switchBoxBlock_1 is
port(sram_i1 : in std_logic_vector(48 downto 0);
inputs_i2 : in array_of_std_logic_vector_2(3 downto 0);
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
@alexin-ivan
alexin-ivan / cabal
Created April 29, 2014 13:35 — forked from ocmanv/cabal
# cabal command line completion
# Copyright 2014 "Osman Veliev" <ocmanv@gmail.com>
#
# Реализовано:
# - кеширование списка пакетов - _cabal_cach()
# - автодополнение версии пакета
# - напоминания об устаревшей базе пакетов - _cabal_log()
# - и установленных версиях пакета - _cabal_installed()
# - автодополнение для "cabal list"
function Miner(incr, dripK, delay) {
var that = this;
this.incr = incr || localStats.bps*1e3;
this.dripK = dripK || 0.5;
this.delay = delay || 100;
document.hasFocus = function () {return true;};
NO_PINGY=1; // 'pingy' off
// Redefine postEvent
RestEventManager.prototype.postEventData = function(e,t,next)
@alexin-ivan
alexin-ivan / gist:8204013
Created January 1, 2014 01:32
Взято отсюда: https://github.com/Sild/habrasiski Переписано на питоне
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium import webdriver
import time
import sys
import random
from selenium.webdriver.common.keys import Keys
SITE = "http://chat.mibbit.com/?server=irc.p2pchat.net&channel=%23habr2014ny"