Skip to content

Instantly share code, notes, and snippets.

View damianbaar's full-sized avatar
🚀

Damian Baar damianbaar

🚀
  • cloudprizm.io
  • void
View GitHub Profile
@damianbaar
damianbaar / Dockerfile
Created August 2, 2019 17:02
docker-nix-buildkit
FROM lnl7/nix:2.2
RUN nix-env -iA \
nixpkgs.curl \
nixpkgs.jq \
nixpkgs.zsh
COPY ./expr.nix .
RUN nix-build expr.nix
WORKDIR result
@damianbaar
damianbaar / example.nix
Last active February 2, 2022 15:00
nix expression that provides a way to copy your zsh configuration files
{ pkgs ? import <nixpkgs> {}
, zdotdir ? import (builtins.fetchurl {
url = "https://gist.githubusercontent.com/damianbaar/57aff242d06c75444dbd36bf5400060e/raw/83d074d45c81a18402146cadc595a20b91bb1985/zdotdir.nix";
}) { inherit pkgs; }
}:
pkgs.stdenv.mkDerivation {
name = "withZshEnv";
shellHook= zdotdir {
zshenv = builtins.path { path = ./zdotdir/zshenv; };
zshrc = builtins.path { path = ./zdotdir/zshrc; };
@damianbaar
damianbaar / atom-sync.js
Created November 1, 2017 07:21
atom-sync
//
@damianbaar
damianbaar / automation-chrome-remote.js
Created June 15, 2017 15:30
Playing with automation and chrome remote
const CDP = require('chrome-remote-interface');
const file = require('fs')
async function screenshot(client, location) {
const {Page} = client
const screenshot = await Page.captureScreenshot({format: 'png'});
const buffer = new Buffer(screenshot.data, 'base64');
file.writeFile(`${location}.png`, buffer, 'base64', function(err) {
if (err) console.error(err)
nnoremap <leader>ti: call GetImport('')<CR>
function! GetImport(word)
let result = json_decode(system('importjs word '.expand('<cword>').' '.expand('%')))
let content = result.fileContent
let cursorPos = getpos(".")
let originalLineCount = line("$")
let @a = content
@damianbaar
damianbaar / keymap.cson
Created March 1, 2017 06:03
atom keymap
# Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@damianbaar
damianbaar / index.js
Last active January 23, 2016 17:09
requirebin sketch
var flyd = require('flyd')
var a = flyd.stream()
var _buffer = []
var buffer = flyd.combine(function(s, self) {
_buffer.push(s())
if(_buffer.length == 2) {
self(_buffer)
_buffer = []
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-alpha.8/dist/global/Rx.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="test1" style="width:200px;height:100px;background:#DDEEFF" >20</div>
<div id="test2" style="width:200px;height:100px;background:#DDDDFF;" >10</div>