Skip to content

Instantly share code, notes, and snippets.

vindarel vindarel

Block or report user

Report or block vindarel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bergantine
bergantine / gist:1171682
Last active Jul 8, 2017
Python Image Encoding in Data URI Scheme Base 64. #python #base64
View gist:1171682
data_uri = open("sample.png", "rb").read().encode("base64").replace("\n", "")
# HTML Image Element
img_tag = '<img alt="" src="data:image/png;base64,{0}">'.format(data_uri)
print img_tag
# CSS Background Image
css = 'background-image: url(data:image/png;base64,{0});'.format(data_uri)
print css
@AdrienLemaire
AdrienLemaire / fabric.plugin.zsh
Created Dec 27, 2011
zsh-completion for Fabric in Oh-my-zsh
View fabric.plugin.zsh
#compdef fab
_targets() {
_describe -t commands "fabric targets" target_list
}
output_levels=(
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
View .pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@shortsightedsid
shortsightedsid / cl-tcpip.lisp
Last active Dec 7, 2019
Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
View cl-tcpip.lisp
; Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
;
; The main reason for this guide is because there are very few examples that
; explain how to get started with socket programming with Common Lisp that I
; could understand. After spending a day trying, I finally came up with a small
; bit of code that makes it easy to understand the basics. I've written this
; primarily for myself, but should help others get started as well.
; As usual, we will use quicklisp to load usocket.
View quicklisp-badges.markdown

Quicklisp badge

Quickdocs.org now provides project badges for Quicklisp projects. It shows Quicklisp dist version when the project was updated last.

Once the project owner adds this badge to their README file, it will inform the project is ready for Quicklisp and its documentation is available on Quickdocs.org.

Stability

It's available, however it was just added in this morning at whim and it may still have issues. Please try it and tell @nitro_idiot if you encountered any issues.

@chebert
chebert / lisp.el
Created Sep 3, 2017
chebert-eval-print-last-sexp
View lisp.el
(defun multiline? (string)
(position ?\n string))
(defun multiline-comment (string)
(concat "#||\n" string "\n||#\n"))
;; Note: Redefining to send the error message too.
(defun chebert-eval-async (sexp &optional cont package)
"Evaluate EXPR on the superior Lisp and call CONT with the result."
(declare (indent 1))
@svetlyak40wt
svetlyak40wt / get-lisp-dependencies.lisp
Last active Oct 31, 2018
A helper to gather all lisp system's dependencies
View get-lisp-dependencies.lisp
(ql:quickload :fset)
(defun get-dependencies (system)
"Returns a set with all dependencies of a given system.
System should be loaded first."
(labels ((normalize (name)
(etypecase name
(string (string-downcase name))
(symbol (normalize (symbol-name name)))
(list
@WetHat
WetHat / CL-Queues.ipynb
Last active Feb 21, 2020
Implementing the QUEUE abstract data type while exploring Common Lisp generic functions.
View CL-Queues.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WetHat
WetHat / CL-PrettyPrintTableData.ipynb
Last active Feb 23, 2020
Pretty Print Table Data in Common Lisp
View CL-PrettyPrintTableData.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WetHat
WetHat / CL-PrettyPrintTrees.ipynb
Last active Feb 23, 2020
Pretty Print Tree Data Structures in Common Lisp
View CL-PrettyPrintTrees.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.