Skip to content

Instantly share code, notes, and snippets.

@mariofink
mariofink / pinboard.stylish.css
Last active April 7, 2021 06:18
Pinboard.in Stylish CSS
@-moz-document url-prefix("https://pinboard.in") {
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.4em;
}
#banner {
width: 100%;
padding-bottom: 1rem;
const { resolve } = require('path');
const { readdir } = require('fs').promises;
const fs = require('fs');
const result = [];
async function* getFiles(dir) {
const dirents = await readdir(dir, { withFileTypes: true });
for (const dirent of dirents) {
const res = resolve(dir, dirent.name);
if (dirent.isDirectory()) {

VIM cheatsheet

Insert

  • i – before cursor
  • a – after cursor
  • O – above current line
  • o – below current line
  • I – beginning of line
  • A – end of line
@mariofink
mariofink / web.config
Last active April 25, 2017 07:06
Microsoft Azure web server configuration for running Laravel
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
@mariofink
mariofink / pre-push.sh
Created April 3, 2017 12:29
Git pre-push hook to avoid pushing tags
#!/bin/sh
while read -d $'0' arg ; do
echo $arg
if [[ $arg == *"/tags/"* ]]; then
echo "Pushing tags is not allowed!"
exit 1
fi
done
# Editors/IDEs #
################
*.swp
.idea
# Node/NPM #
############
node_modules
npm-debug.log
@mariofink
mariofink / dabblet.css
Created August 29, 2012 18:20
CSS3 transforms & transitions
/**
* CSS3 transforms & transitions
*/
body {
font-family: sans-serif;
}
.box {
background: #bada55;
border-radius: 1em;
width: 15em;
@mariofink
mariofink / CSS3 gradient button
Created October 12, 2011 12:33
COMPASS mixin: CSS3 gradient button
@import "compass/reset";
@import "compass/css3";
@mixin gradientButton($baseColour: #eee, $textColour: #333) {
$darker-1: darken($baseColour, 7%); /* ~#ddd */
$darker-2: darken($baseColour, 15%); /* ~#ccc */
$darker-3: darken($baseColour, 20%); /* ~#bbb */
$darker-4: darken($baseColour, 34%); /* ~#999 */
$active-1: darken($baseColour, 27%); /* ~#aaa */
module.exports = function (grunt) {
grunt.initConfig({
/**
* Build JS code from AMD modules with Browserify
*/
browserify: {
testspecs: {
src: ["scripts/test/spec/<%= browserifySpecs %>.js"],
dest: 'scripts/test/specs-built.js'
}
@mariofink
mariofink / gist:3dbeb9e206933885bab8
Created May 3, 2014 15:27
SASS Find unused variables
#! /usr/bin/env bash
#
# checks your scss files for unused variables
#
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
fi
if [ ! -d "$1" ]; then