Skip to content

Instantly share code, notes, and snippets.

Javier Olaechea PuercoPop

Block or report user

Report or block PuercoPop

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
View vis-sprintf.patch
index 124e380..1e8b8f8 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2643,7 +2643,8 @@ void vis_lua_init(Vis *vis) {
* - /usr/(local/)?share/vis (or whatever is specified during ./configure)
* - package.path (standard lua search path)
*/
- char path[PATH_MAX];
+ char *path;
+ size_t path_len;
View 15-2.lisp
(defun next (prev factor)
(rem (* prev factor) 2147483647))
(defun solve/2 (limit initial-a initial-b)
(let ((gen-a initial-a)
(gen-b initial-b)
(match-count 0)
(success-count 0))
(tagbody
next-a
View prettier-vis.lua
m = {}
m.prettier_command = "npx prettier"
m.prettier_args = " "
function format_prettier()
local file = vis.win.file
local cmd = m.prettier_command .. m.prettier_args .. file.path
-- Range should default to selection if present:
View scratch.st
| win toolbar workspc workspcModel loadBtn saveBtn |
win _ SystemWindow new.
workspcModel _ Workspace withText: 'Transcript show: ''foo'''.
workspc _ TextModelMorph withModel: workspcModel.
toolbar _ LayoutMorph newRow.
loadBtn _ PluggableButtonMorph model: workspc
action: #switch
View clx-xinerama-test.lisp
;; (ql:quickload :clx)
(destructuring-bind (hostname display-id screen-id protocol)
(xlib::get-default-display ":1")
(let ((display (xlib:open-display hostname :display display-id :protocol protocol)))
(xlib/xinerama:xinerama-is-active display)))
View sortNumbers.js
// time sortNumbers.js => 0.196
function randomInteger(lowerBound, upperBound) {
return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound));
}
function* randomNumbers(count) {
for (var i=0; i < count; i++) {
yield randomInteger(1, 10);
}
}
View sortNumbers.js
// time sortNumbers.js => 0.196
function randomInteger(lowerBound, upperBound) {
return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound));
}
function* randomNumbers(count) {
for (var i=0; i < count; i++) {
yield randomInteger(1, 10);
}
}
View foo.py
def parse_year_month(year_month):
return year_month.split("-")
def find_teams_that_disappeared_in_month(year_month):
current_year, current_month = parse_year_month(year_month)
if current_month == "01": # O is_january(current_month)
return frozenset()
previous_month = month_before(current_month)
current_teams = teams_in_month(current_month)
View meta-helix-primary-key-example.lisp
;; https://github.com/eudoxia0/crane/issues/51#issuecomment-184441942
(defpackage #:meta-helix-example
(:use #:cl #:c2mop)
(:import-from #:alexandria
#:if-let
#:when-let)
(:shadowing-import-from #:c2mop
#:standard-generic-function
#:defgeneric
#:defmethod)
You can’t perform that action at this time.