Skip to content

Instantly share code, notes, and snippets.

@Jerakin
Jerakin / luacheck_std.luacheckrc
Last active April 29, 2021 22:33
Luacheck and Defold
return {
stds = {
defold = {
read_globals = {
"go", "gui", "msg", "url", "sys", "render", "factory", "particlefx", "physics", "sound", "sprite", "image",
"tilemap", "vmath", "matrix4", "vector3", "vector4", "quat", "hash", "hash_to_hex", "hashmd5", "pprint",
"iap", "facebook", "push", "http", "json", "spine", "zlib", "collectionfactory",
"__dm_script_instance__", "socket", "adtruth", "jit", "bit", "window", "webview", "profiler", "resource",
"collectionproxy", "label", "model", "timer", "zlib", "html5", "buffer", "crash", "bit32",
"RenderScriptConstantBuffer", "RenderScriptPredicate", "RenderScript", "GuiScript", "GuiScriptInstance"
@bszwej
bszwej / echo.js
Last active April 26, 2024 05:22
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
@certainlyakey
certainlyakey / library.scss
Last active March 5, 2024 16:40
URL-encode color SASS function / convert color to hex SASS function
//does not work with colors containing alpha
@function encodecolor($string) {
@if type-of($string) == 'color' {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
}
$string: '%23' + $string;
@return $string;
}
@Coeur
Coeur / README.md
Last active October 18, 2020 21:41 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install osxfuse (3.x.x) from https://github.com/osxfuse/osxfuse/releases.

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@JimmyRittenborg
JimmyRittenborg / compress.liquid
Last active June 17, 2023 12:11
HTML Compressor in Shopify Liquid
{% comment %}
Input
{% endcomment %}{% capture _content %}{{ content }}{% endcapture %}{% comment %}
Remove redundant closing tags
{% endcomment %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% for _element in _endings %}
{% capture _end %}</{{ _element }}>{% endcapture %}
@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"