Skip to content

Instantly share code, notes, and snippets.

@zehnpaard
zehnpaard / dune
Created Jun 10, 2019
OCaml template for menhir/ocamllex/dune indentation-aware parser
View dune
(menhir
(modules parser))
(ocamllex lexer)
(executable
(name ex))
@Linux-BSD
Linux-BSD / VoidLinux-On-System76_GalagoPro2.md
Last active May 24, 2021
Some Notes on Void Linux on System76 Galagopro 2.
View VoidLinux-On-System76_GalagoPro2.md

These are some notes for running void linux on System76 Galagopro 2. Don't blindly cut-copy-paste, use your common sense.

Kernel

Some useful Kernel boot options.

In /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="splash loglevel=4 slub_debug=P page_poison=1 ec_sys.write_support=1 atkbd.reset intel_pstate=skylake_hwp psmouse.synaptics_intertouch=1 video=eDP-1:2048x1152-32@60 i915.enable_dc=2 i915.enable_guc=3 i915.modeset=1 i915.disable_power_well=0 i915.fastboot=1"
@branneman
branneman / fp-lenses.js
Last active Feb 25, 2020
JavaScript: Lenses (Functional Programming)
View fp-lenses.js
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
@maisano
maisano / RouteTransition.jsx
Last active Mar 17, 2021
Using react-motion with react-router
View RouteTransition.jsx
import React, { PropTypes } from 'react';
import { TransitionMotion, spring } from 'react-motion';
/**
* One example of using react-motion (0.3.0) within react-router (v1.0.0-rc3).
*
* Usage is simple, and really only requires two things–both of which are
* injected into your app via react-router–pathname and children:
*
* <RouteTransition pathname={this.props.pathname}>
@strobe
strobe / .emacs
Last active Aug 6, 2016
osx emacs config for scala
View .emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; !! General Settings !!
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@alanpeabody
alanpeabody / .projections.json
Last active Aug 29, 2015
Ember App Kit & vim-projectile
View .projections.json
{
"app/models/*.js": {
"command": "model",
"template": [ "export default DS.Model.extend({", "});" ]
},
"app/router.js": { "command": "router"},
"app/routes/*.js": {
"command": "route",
"template": [ "export default Ember.Route.extend({", "});" ],
"alternate": "app/controllers/%s.js"
View Gruntfile.js
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
aws: grunt.file.readJSON(process.env.HOME + '/grunt-aws.json'),
copy: loadConfig('copy'),
concat: loadConfig('concat'),
s3: loadConfig('s3'),
dockerfiles: {
options: {
packageInstall: 'pacman -S --noconfirm "<%= package.name %><%= package.version %>"',
// or function(name, version) { return "pacman -S --noconfirm " + name + version; }
@bigfive
bigfive / active_admin_helper.rb
Last active Nov 15, 2018
Active admin reskin
View active_admin_helper.rb
module ActiveAdminHelper
def admin_arbre_context
@admin_arbre_context ||= Arbre::Context.new(assigns, self)
end
def default_renderer
case controller.send(:resource_class).name
when "ActiveAdmin::Page"
"page"
@crosbymichael
crosbymichael / server.go
Created May 26, 2013
Quick and simple static file server in Go. No more python -m SimpleHttpServer
View server.go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
)