Skip to content

Instantly share code, notes, and snippets.

Avatar

Barry Walsh draegtun

View GitHub Profile
View sql-lexer.bnf
Statement ::= (Newline | Whitespace | '(' | ')' | ',' | '.' | Value | ';')*
Value ::= Comment-Line | Comment | String-Single | String-Double | Literal | Variable | Word | Number | Misc
Comment-Line ::= ('--' | '#') [^#xA#xD]*
Comment ::= '/*' ( [^*] | '*'+ [^*/] )* '*'* '*/'
String-Single ::= "'" ([^'\]+ | '\\' | "\'" | "''")* "'"
@maximvl
maximvl / poor-mans-scopes.red
Last active Aug 14, 2019
Dynamic variables in Red
View poor-mans-scopes.red
Red [
author: "Maxim Velesyuk"
description: "Dynamic variables implementation for Red"
]
; utils
forskip: func ['series skipn body /local s] [
s: get series
while [ not tail? s ] [
do body
@maximvl
maximvl / restarts.red
Last active Aug 14, 2019
CL condition-restarts in Red
View restarts.red
Red [
author: "Maxim Velesyuk"
description: "Common Lisp condition-restart system implementation for Red"
]
; utils
*word-counter*: 0
gen-word: does [
*word-counter*: *word-counter* + 1
to-word append "G-" to-string *word-counter*
@plentz
plentz / nginx.conf
Last active Sep 13, 2021
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View spamcomment.pl
#!/usr/bin/env perl
use strict;
use LWP::Simple;
sub pick { $_[rand @_] }
my $text = get "https://gist.github.com/shanselman/5422230/raw/9863d88bde2f9dcf6b2e7a284dd4a428afdc8c8b/gistfile1.txt";
my @samples = split /\|\n/, $text;
my $template = pick @samples;
@tobyink
tobyink / AcmeConstructorPythonic.pm
Created Oct 21, 2012
As per Hercynium's suggestion...
View AcmeConstructorPythonic.pm
use strict;
use warnings;
BEGIN {
package Acme::Constructor::Pythonic;
no thanks;
use Data::OptList qw(mkopt);
use Sub::Install qw(install_sub);
use Module::Runtime qw(use_module);
sub import {
@c9s
c9s / perlfold.vim
Created Sep 19, 2012
fold options for perl
View perlfold.vim
syntax on
filetype on
filetype plugin indent on
let perl_include_pod = 1
let perl_extended_vars = 0
let perl_want_scope_in_variables = 1
let perl_fold = 1
let perl_fold_blocks = 1
set foldenable
@spicycode
spicycode / tmux.conf
Created Sep 20, 2011
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000