Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Making Ultralisp.org

Alexander Artemenko svetlyak40wt

💭
Making Ultralisp.org
View GitHub Profile
@svetlyak40wt
svetlyak40wt / travis-badges.lisp
Last active Jan 20, 2021
A generator for Travis Matrix badges.
View travis-badges.lisp
;; Run (ql:quickload :cl-yaml) before loading this script
(defpackage #:travis-badges
(:use #:cl)
(:import-from #:cl-yaml)
(:export
#:make-badges))
(in-package travis-badges)
@svetlyak40wt
svetlyak40wt / weblocks-toast.lisp
Last active Dec 31, 2020 — forked from bamboospirit/weblocks toast.lisp
weblocks simple toast effect (common lisp web framework ui frontend)
View weblocks-toast.lisp
(ql:quickload '(:weblocks :weblocks-lass :weblocks-navigation-widget :weblocks-ui :find-port))
(defpackage app-package
(:use #:cl
#:weblocks-ui/form
#:weblocks/html)
(:import-from #:parenscript #:ps #:chain)
(:import-from #:weblocks-navigation-widget #:defroutes)
(:import-from #:weblocks/routes #:reset-routes)
(:import-from #:weblocks/session #:*session*)
@svetlyak40wt
svetlyak40wt / lw-current-lang.lisp
Created Dec 12, 2020
An example how to get user's preferred language on OSX and Windows using LispWorks.
View lw-current-lang.lisp
#+cocoa
(defun current-language ()
(let ((lang (objc:with-autorelease-pool ()
(objc:invoke-into
'string
(objc:invoke
(objc:invoke "NSUserDefaults" "standardUserDefaults")
"objectForKey:" "AppleLanguages")
"objectAtIndex:" 0))))
;; 2019-04-29
@svetlyak40wt
svetlyak40wt / weblocks-autocomplete.lisp
Created Sep 24, 2020
Example of autocompletion box using Weblocks
View weblocks-autocomplete.lisp
;; This example illustrates how to call actions from JS and update the widget in response.
;; It is incomplete but could be refactored into reusable library.
;; Hope, somebody will do this some day.
(defpackage #:weblocks-autocomplete
(:use #:cl))
(in-package weblocks-autocomplete)
(ql:quickload '(weblocks log4cl))
@svetlyak40wt
svetlyak40wt / jinja2-python2.7.py
Created Sep 14, 2020
Test for Jinja2 performance on Python2.7
View jinja2-python2.7.py
# Test for this post:
# https://40ants.com/lisp-project-of-the-day/2020/09/0188-zenekindarl.html
Python 2.7.16 (default, Apr 17 2020, 18:29:03)
Type "copyright", "credits" or "license" for more information.
IPython 5.10.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
View lack-server-side-events.lisp
;; This example was created to help the author of this thread:
;; https://www.reddit.com/r/Common_Lisp/comments/hu019r/what_is_the_recommended_way_to_readunderstand/
;; Before loading this code, do this in the REPL:
;; (ql:quickload '(log4cl spinneret clack lack))
(defpackage #:server-side
(:use #:cl))
(in-package server-side)
View fixed-transform-function-definer-options.lisp
(defun transform-function-definer-options (options)
(bind ((debug-level (normalize-debug-level
(getf options :debug (max #+sbcl (sb-c::policy-quality sb-c::*policy* 'debug)
(or (production-only* 0)
1))))))
(when (> debug-level 0)
(remove-from-plistf options :inline :optimize))
(list* :debug debug-level
(remove-from-plist options :debug))))
View covid-19.xlsx
<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?><ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><ss:Styles><ss:Style ss:Name="Normal" ss:ID="Default"><ss:Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/><ss:Font xmlns:x="urn:schemas-microsoft-com:office:excel" ss:Color="#000000" ss:Size="11" x:Family="Swiss" ss:FontName="Arial"/></ss:Style><ss:Style ss:Parent="Default" ss:ID="String"><ss:NumberFormat ss:Format="@"/></ss:Style><ss:Style ss:Parent="String" ss:ID="Notes"><ss:Font xmlns:x="urn:schemas-microsoft-com:office:excel" ss:Color="#666666" ss:Size="9" x:Family="Swiss" ss:FontName="Arial"/></ss:Style><ss:Style ss:Parent="String" ss:ID="HyperLink"><ss:Font ss:Underline="Single" ss:Color="#0000FF"/></ss:Style><ss:Style ss:Parent="Default" ss:ID="ShortDate"><ss:NumberFormat ss:Format="Short Date"/></ss:Style><ss:Style ss:Parent="Default" ss:ID="Currency"><ss:NumberFormat ss:Format="_(&quot;$&quot;* #,##0.00_);_(&quot;$&quot;* (#,##0.00);_(&quot;$&quot;*
@svetlyak40wt
svetlyak40wt / breadcrumbs.lisp
Last active Mar 12, 2020
A spinneret breadcrumbs example.
View breadcrumbs.lisp
(defvar *breadcrumbs*)
(defun render-breadcrumbs ()
(with-html
(:ul
(loop for (text . url) in *breadcrums*
do (:li (:a :href url
text))))))
@svetlyak40wt
svetlyak40wt / html-test.lisp
Last active Mar 12, 2020 — forked from xh4/html-test.lisp
Common Lisp HTML Generation Test
View html-test.lisp
(in-package :cl-user)
(ql:quickload :cl-who)
(ql:quickload :spinneret)
(defpackage :html-test
(:use :cl :cl-who :spinneret))
(in-package :html-test)
You can’t perform that action at this time.