Instantly share code, notes, and snippets.

View bb.sh
#!/usr/bin/env bash
# BashBlog, a simple blog system written in a single bash script
# (C) Carlos Fenollosa <carlos.fenollosa@gmail.com>, 2011-2016 and contributors
# https://github.com/carlesfe/bashblog/contributors
# Check out README.md for more details
# Global variables
# It is recommended to perform a 'rebuild' after changing any of this in the code
View languages.txt
1. Clojure/Chicken Scheme -
When you want to have fun with programming (Clojure & Scheme is still pretty productive, IMHO)
2. C -
When you want to implement a bootloader, kernel, OS, memory manager and low-level
stuff you wanna program, and ubiquitous C APIs/libraries.
3. Python -
When you simply want to get the job done with vast amount of libraries
while enjoying the formalism, and expressiveness of the language.
View chucker.scm
(use tcp
args
loops)
;; port-open? : string integer -> boolean
(define (port-open? host port)
(condition-case
(begin
(tcp-connect host port)
#t)
View c-style.txt
Style
------
Note that the following are guidelines and the most important aspect of style is consistency.
Strive to keep your style consistent with the project on which you are working.
Recommended Reading
---------------------
The following contain good information, some of which is repeated below, some of which is contradicted below.
http://doc.cat-v.org/bell_labs/pikestyle
View .perltidyrc
# indentation spaces [3/307]
-i=4
# broken line indentation spaces
-ci=4
# length of collumn
-l=80
# spaces in parentheses
View .Xresources
xterm*VT100.Translations: #override \
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD)
xterm*background: black
xterm*foreground: lightgray
View .emacs
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
;;(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
View .gitignore
# http://www.gnu.org/software/automake
torios_internet*
Makefile
Makefile.in
config.*
*.zip
*.tar.gz
.deps
.objs
*~
View kwargs_1
# python
def printArgs(*args, **kwargs):
print kwargs
>>> printArgs(a=1, b=2)
{'a': 1, 'b': 2}
# perl
use Data::Dumper;
sub printArgs {
View access.pl
use DBI;
use v5.10;
# dependencies: DBI, DBD::mysql, libmysqlclient-dev, mysql-server
# to create a new database, use 'mysqladmin create my_database_name -u username -p'
# default mysql port is 3306
my $dbh = DBI->connect("dbi:mysql:database=dummy;host=localhost",
"root", "my_password");