Skip to content

Instantly share code, notes, and snippets.

@richardkall
richardkall / .stylelintrc.js
Created May 26, 2019 16:25
.stylelintrc.js
module.exports = {
extends: ['stylelint-config-recommended', 'stylelint-prettier/recommended'],
plugins: ['stylelint-order', 'stylelint-value-no-unknown-custom-properties'],
rules: {
'at-rule-no-vendor-prefix': true,
'color-hex-length': 'short',
'color-named': ['never', { ignoreProperties: ['/composes/'] }],
'color-no-hex': true,
'declaration-block-no-redundant-longhand-properties': true,
'declaration-no-important': true,
@richardkall
richardkall / global.d.ts
Last active May 26, 2019 16:23
Jest SVG and CSS modules mocks
declare module '*.svg' {
const content: any;
export default content;
}
declare module '*.css' {
const classNames: { [className: string]: string };
export default classNames;
}
@richardkall
richardkall / wepack.config.js
Last active May 26, 2019 16:20
Webpack CSS loaders
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = (env = { production: false }) => ({
module: {
rules: [
{
test: /\.css$/,
use: [
...(env.production
@richardkall
richardkall / Base16 Default Dark.terminal
Created September 11, 2016 08:03
OS X Terminal Color Schemes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECow
LjA4MjM1Mjk0MzcyIDAuMDgyMzUyOTQzNzIgMC4wODIzNTI5NDM3MgAQAYAC0hAREhNa
JGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFy
@richardkall
richardkall / nvm.sh
Last active April 17, 2016 14:21
Improve shell startup time by commenting out lines in nvm.sh (nvm 0.31.0). See https://github.com/creationix/nvm/issues/860.
# Node Version Manager
# Implemented as a POSIX-compliant function
# Should work on sh, dash, bash, ksh, zsh
# To use source this file from your bash profile
#
# Implemented by Tim Caswell <tim@creationix.com>
# with much bash help from Matthew Ranney
{ # this ensures the entire script is downloaded #
@richardkall
richardkall / rsync-exclude.sh
Last active April 17, 2016 14:24
Exclude files when using rsync
# Using .rsync-filter
$ rsync -avz --delete --exclude-from=".rsync-filter" -e "ssh" --rsync-path="sudo rsync" project/* user@example.com:/project
# Using pattern
$ rsync -avz --exclude=".DS_Store" -e "ssh" --rsync-path="sudo rsync" project/* user@example.com:/project
@richardkall
richardkall / store.coffee
Last active December 3, 2023 22:08
Ember.js REST adapter without JSON root element.
App.Adapter = DS.RESTAdapter.extend
serializer: DS.RESTSerializer.extend
extract: (loader, json, type, record) ->
root = @rootForType(type)
// Embed JSON data in a new object with root element
newJSON = {}
newJSON[root] = json
json = newJSON
//
@richardkall
richardkall / LICENSE
Last active December 16, 2015 07:19
MIT License
The MIT License (MIT)
Copyright (c) Richard Käll <richard.kall@me.com> (richardkall.se)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@richardkall
richardkall / nginx.conf
Last active December 16, 2015 07:18
Nginx + PHP5
charset utf-8;
gzip_disable "msie6";
gzip_types text/plain text/css application/x-javascript application/xml text/javascript;
# www.example.com
server {
listen 80;
server_name *.example.com;
rewrite ^(.*) http://example.com$1 permanent;

#Password-less SSH

Generate keys on local machine:

$ ssh-keygen

Create ~/.ssh directory on remote machine.