Skip to content

Instantly share code, notes, and snippets.

View lorefnon's full-sized avatar

Lorefnon lorefnon

View GitHub Profile
@lorefnon
lorefnon / gist:6483958
Created September 8, 2013 11:18
Entypo Icon font CSS class mapping
.icon {
font-family: 'EntypoRegular';
}
.icon.social {
font-family: 'EntypoSocialRegular';
}
.icon.phone:before { content: '\1F4DE';}
.icon.mobile:before { content: '\1F4F1';}
.icon.mouse:before { content: '\E789';}
@lorefnon
lorefnon / gist:429d86160129c9e6ca32
Created June 17, 2014 14:47
pre-commit hook to check for debugger invocations in ruby source.
echo "\n--"
echo "Checking for debugger calls"
echo "--\n"
for name in `git diff --name-only --cached`
do
echo "Analysing: $name"
cat $name | egrep -n "\b(byebug|binding.pry|debugger)\b" | while read line
do
echo " -> $line"
echo "\n--"
@lorefnon
lorefnon / 01_utils.scss
Last active October 24, 2015 19:30
One SCSS file to rule them all
// So you have co-workers who love raving about buzzwords like Semantic styles, unobstructive css, BEM etc
// which never made sense?
//
// Drop this into your project, grab some popcorn and hit commit.
//
// Now the screams begin ...
@each $dim in 5, 10, 20 {
@each $attr-key, $attr in (m: margin, p: padding) {
.u-#{$attr-key}#{$dim} { #{$attr}: #{$dim}px; }
[alias]
l = log
i = init
cl = clone
d = diff
dn = --no-pager diff --name-only
di = icdiff
pr = pull-request
dc = diff --cached
dci = icdiff --cached
@lorefnon
lorefnon / .emacs
Last active January 22, 2017 19:36
My emacs config
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(show-paren-mode t)
'(tool-bar-mode nil)
'(tooltip-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
@lorefnon
lorefnon / .spacemacs
Last active January 2, 2018 05:29
Spacemacs config file
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@lorefnon
lorefnon / package.json
Created August 18, 2018 19:44
Integrating next.js, Apollo Server and Koa
{
"main": "server/index.js",
"scripts": {
"dev": "nodemon --watch server server/index.js",
"build": "next build",
"start": "NODE_ENV=production node server/index.js"
},
"dependencies": {
"apollo-boost": "^0.1.13",
"apollo-server": "^2.0.4",
@lorefnon
lorefnon / .carbon-now.json
Last active April 24, 2019 18:22
Markdown transformer to convert Code blocks to embedded (base64 encoded) images syntax highlighted by carbon.now.sh
{
"latest-preset": {
"t": "dracula",
"bg": "transparent",
"wt": "sharp",
"wc": true,
"fm": "Fira Code",
"fs": "11px",
"ln": false,
"ds": true,
@lorefnon
lorefnon / README.md
Last active May 19, 2019 10:51
Chevrotain parser for a subset of jq syntax

About

Parses jq-inspired concise object access & transformation syntax using chevrotain

Supported

  • Object member access: .bar.baz
  • Array member access: .[0]
  • Slices: .[0:9]
  • Construction of objects and arrays: {a: .b.c}, {b: .[0].foo}, [.a.b, .c.d]
@lorefnon
lorefnon / index.js
Created November 25, 2019 18:13
GRelDAL custom operations without Database interactions
const { mapSchema } = require("greldal");
const { graphql, GraphQLString } = require("graphql");
const customOperation = {
operationType: "query",
name: "printHello",
fieldConfig: {
type: GraphQLString,
description: "Prints hello",
resolve: (obj, args, context, info) => {