Skip to content

Instantly share code, notes, and snippets.

View nordicdyno's full-sized avatar
😐

Alexander Orlovsky nordicdyno

😐
View GitHub Profile
/*
The MIT License (MIT)
Copyright (c) 2014 Ismael Celis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
BEGIN {
use lib "/Users/vti/dev/protocol-websocket/lib";
}
@leafstorm
leafstorm / lasi.rst
Created January 22, 2011 21:47
A draft of a Lua gateway interface to replace WSAPI.

Lua Application/Server Interface version 1.0

Author: Matthew "LeafStorm" Frazier <leafstormrush@gmail.com>
Date: February 4, 2011
Status: Early draft

This document specifies an interface between Web servers and Web applications written in the Lua programming language, to promote interoperability between Web servers and the development of an ecosystem of reusable components for Lua

#compdef cpanm
#autoload
typeset -A opt_args
local context state line
_arguments -C \
'(-h)'{-h,--help}'[prints help]' \
'(-v --verobse)'{-v,--verbose}'[turn on chatty output.]' \
'(-q --quiet)'{-q,--quiet}'[turn off the most output.]' \
@msantos
msantos / bpf.c
Last active April 2, 2024 18:54
Example of using bpf to capture packets
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@chenkaie
chenkaie / fdhijack.sh
Created December 2, 2011 18:00
Redirect stdin, stdout, stderr of a daemon to /dev/pts/#
#!/bin/sh
#
# Redirect stdin, stdout, stderr of a daemon to /dev/pts/#
#
#################################################################################################################
# Ref: stdio buffering: http://www.pixelbeat.org/programming/stdio_buffering/
# Default Buffering modes:
# stdin -> is always buffered
# stderr -> is always unbuffered
# if stdout is a terminal then buffering is automatically set to line buffered, else it is set to buffered
@wki
wki / css_parser.pl
Created December 22, 2011 19:48
Sample CSS Parser using Marpa::XS
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{
@gurugray
gurugray / yandex-mail.archive.user.js
Created March 24, 2012 11:57
кнопка «Архив» для почты Яндекса
// ==UserScript==
// @name «Yandex Mail Archive button»
// @namespace gurugray
// @author Sergey sergeev (gurugray)
// @version 0.2.4
// @homepage_url https://raw.github.com/gist/2181532/yandex-mail.archive.user.js
// @description Создаём кнопку «В архив» на web-почте Яндекса
// @include http*://mail.yandex*/neo2/*
use Mojolicious::Lite;
use EV;
use AnyEvent;
use AnyEvent::Util;
get '/' => sub {
my $self = shift;
# Run Perl oneliner in separate process and capture STDOUT
fork_call {