Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
open -a "Google Chrome" "https://www.youtube.com/watch?v=1AnG04qnLqI" && \
ruby -r irb -e 'IRB.send(:easter_egg, :dancing)'
/* .config/gtk-3.0/gtk.css */
window.ssd headerbar.titlebar {
min-height: 0;
padding-top: 2px;
padding-bottom: 2px;
}
window.ssd headerbar.titlebar button.titlebutton {
min-height: 0;
min-width: 0;
@lcmen
lcmen / config
Created February 15, 2024 16:06
Running mate settings daemon, screensaver and power manager in i3
# ~/.config/i3/config
exec --no-startup-id exec mate-settings-daemon
exec --no-startup-id exec mate-screensaver
exec --no-startup-id exec mate-power-manager
exec --no-startup-id exec nm-applet
@lcmen
lcmen / user_test.exs
Last active July 19, 2022 17:53
Task.async vs Kernel.spawn with async tests using manual sandbox mode in Ecto.
defmodule ScratchApp.UserTest do
use ExUnit.Case, async: true
alias ScratchApp.{Repo,User}
setup do
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
end
test "it should fail and it does indeed" do
@lcmen
lcmen / .vimrc
Created April 17, 2020 17:37
Make custom vim-test runner to run ember qunit tests
" vim-test for ember
" make sure ember.vim file exists in .vim/autoload/test/ember.vim
let test#custom_runners = {'javascript': ['Ember']}
@lcmen
lcmen / components.my-form.js
Last active August 27, 2019 15:21
Ember.js - DOM events
import Ember from 'ember';
export default Ember.Component.extend({
submit(e) {
e.preventDefault();
alert("I'm native DOM event");
}
});
@lcmen
lcmen / application.controller.js
Created October 21, 2018 18:12 — forked from azizpunjani/application.controller.js
Contextual components yielding multiple blocks
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
<nav className='navbar'>
{
userRole === 'admin' && (
<AdminPanel />
) || userRole === 'user' && (
<UserPanel />
) || (
<StatusPanel />
)
}
@lcmen
lcmen / remotepaste.md
Created July 1, 2017 17:36 — forked from burke/remotepaste.md
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@lcmen
lcmen / script.sh
Last active April 7, 2017 11:26
[Generate CSR for SSL] Shows how to generate CSR for SSL certificate. #tags: shell
openssl req -new -newkey rsa:2048 -nodes -keyout example.key -out example.csr
# For common name enter full domain, for wildcard use *.example.com format
# If you received bundle separately from root then you need to combine them:
cat domain.crt domain.sa-bundle >> domain-bundle.crt
# Verify cert
openssl s_client -connect foo.example.com:443 < /dev/null | openssl x509 -text