A metatable can be defined like
local t = setmetatable({}, {
__tostring = function() return 'custom tostring behavior!' end
})
Here are the metamethods that you can define, and their behavior
/* | |
* Creator: Naman Dixit | |
* Notice: © Copyright 2024 Naman Dixit | |
* License: BSD Zero Clause License | |
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html) | |
* Language: -*- objective-c -*- | |
*/ | |
/* | |
* This is a minimal Objective-C runtime designed for easy embeddability and DLL-based hot-reloading. |
-- Installs "file_fdw" extension and creates foreign table to work with data from CSV file. | |
-- See also the comment below which helps to automate the process for Google Spreadsheets | |
-- Another option would be using Multicorn for Google Spreadsheets, but it requires additional steps | |
-- (see https://wiki.postgresql.org/wiki/Foreign_data_wrappers). | |
create extension file_fdw; | |
create server "import" foreign data wrapper file_fdw; | |
create foreign table "table1" ( | |
col1 text, |
// go on you labels pages | |
// eg https://github.com/cssnext/cssnext/labels | |
// paste this script in your console | |
// copy the output and now you can import it using https://github.com/popomore/github-labels ! | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), |
This is a silly little private layer I put together for Spacemacs to allow me to open the current (Markdown) buffer in Marked 2.app when I hit the key combo SPC om
. Since I am very new to both Emacs and Spacemacs, I am not at all confident that the functions are in the appropriate places, and I am sure it could be done more simply. Having said all that, it works!
To activate it put the two .el
files above within a folder called 'marked' within your 'private' folder (or whatever folder you have pointed dotspacemacs-configuration-layer-path
at). Then you just need to add marked
to your dotspacemacs-configuration-layers
list in your .spacemacs
.
#!/usr/bin/xcrun swift | |
// | |
// Copyright © 2016 Leon Breedt | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |