Skip to content

Instantly share code, notes, and snippets.

View kematzy's full-sized avatar

Kematzy kematzy

View GitHub Profile
@kematzy
kematzy / Neovim-CSS-LSP-Fix.md
Created March 29, 2024 12:55
Neovim, LSP, CSS and 'Unknown at rule @tailwind'

How to fix "Unknown at rule @[type]" warnings in NeoVim

When using Tailwind CSS within a .css file in Neovim with cssls (CSS Language Server) linting enabled, these type of diagnostic warnings are shown:

@tailwind base;   /* - Unknown at rule @tailwind */

body {
 @apply text-red-500; /* - Unknown at rule @apply */
@kematzy
kematzy / vscode-snippets-placeholder-transformation-tutorial.md
Last active May 8, 2024 08:36
VS Code Snippets Placeholder Transformations Tutorial

VS Code Snippets Placeholder Transformations

This is a quick tutorial on how to create VS Code snippets that formats your snippet placeholder variables correctly.

Hopefully Google will show this in the search results so that others that are struggling in this area can be helped.


@kematzy
kematzy / .stylelintrc.json
Last active November 5, 2022 12:41
Setting up VS Code with Jekyll, Tailwind CSS, PostCSS ('jekyll-postcss') and stylelint with SCSS-like syntax support
{
"extends": ["stylelint-config-recommended"],
"processors": ["stylelint-processor-ignore-front-matter"],
"rules": {
"at-rule-no-unknown": [true, {
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
} ],
"declaration-block-trailing-semicolon": "always",
"no-descending-specificity": [true, { "ignore": ["selectors-within-list"] } ],
"no-invalid-double-slash-comments": true
@kematzy
kematzy / kematzy.hasura.audit_trail.sql
Last active January 29, 2024 17:48
Hasura AuditTrail by Kematzy
-- ## Kematzy Hasura AuditTrail
-- This is based on the [Hasura/audit-trigger](https://github.com/hasura/audit-trigger).
--
-- Changes from the Hasura version:
-- 1. Simplified audit table schema with these changes:
-- a. Renamed columns to lowerFirst format.
-- b. Changed order of columns.
-- c. Combined schema & table name into one column.
-- d. Stores the record `id` UUID value in the `rowId` column.
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things".
"1", "Something", "0.50", "2013-05-05 10:00:00"
"2", "Another thing", "1.50", "2013-06-05 10:30:00"
# Now you want to import it, go to the command line and type:
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;"
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this:
@kematzy
kematzy / solution.md
Last active August 29, 2015 14:18
Nginx, Passenger, Ruby, Mac OS X - Error 502 response: application did not send a complete response

Notes for myself or other Google searches

Using Mac OS X Yosemite (10.10.2) with Ruby 2.1.5 and Nginx 1.6.2 and Passenger 5.0.5 installed via Homebrew.

Scenario

You are developing an app / website and have done most of the development using thin / webbrick etc without any problems, and now when you try to view your website / app in Nginx / Passenger you encounter this problem:

App 16220 stderr: [ 2015-04-07 08:05:46.0788 16486/0x007fc56c07b640(Worker 1) utils.rb:85 ]: \

*** Exception Encoding::InvalidByteSequenceError in Rack application object \

@kematzy
kematzy / app.js
Last active August 29, 2015 14:03
Phusion passenger ubuntu 14.04 nginx node js 403 Forbidden
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end("hello from NodeJS App via Phusion Passenger with nginx!\n");
});
server.listen(3000);
The objective of this post is to get you from absolutely nothing, to a fully functional nodejs environment.
Software used: Ubuntu 11.10, Nodejs v0.6.12, Nginx, MongoDB, Redis, and NPM modules.
1. Download and install the latest version of Ubuntu: http://www.ubuntu.com/download (don't select any extra items to install when prompted)
2. Once you are logged in and are at your Ubuntu command prompt, install the necessary software you will need:
a. sudo apt-get install openssh-server
b. sudo apt-get install libssl-dev
c. sudo apt-get install git
d. sudo apt-get install g++
e. sudo apt-get install make
@kematzy
kematzy / pony.test.rb
Created September 4, 2012 16:37
Ruby Emails with Pony gem, and MockSMTP on Mac OS X "Mountain Lion"
### MockSMTP, ruby, Pony, Mac OS X, Mountain Lion
#
# Setup example that works on Mountain Lion with MockSMTP and pony.
#
#
require 'rubygems'
require 'pony'
@kematzy
kematzy / .bash_profile
Created March 29, 2012 08:58
Default .bash_profile for use on web servers
# ~/.bash_profile: executed by bash(1) for login shells.
umask 002
# PS1='[\h:$PWD]$ '
# sets [ USER @ HOSTNAME RELATIVE PATH]$
export PS1="[\u@\[\e[32;1m\]\H \[\e[0m\]\w]\$ "
export LSCOLORS="exfxcxdxbxegedabagacad"