Skip to content

Instantly share code, notes, and snippets.

View srghma's full-sized avatar

Serhii Khoma srghma.github.io/how-life-was-created srghma

View GitHub Profile
@i-e-b
i-e-b / Readme_NIX_OS.md
Last active July 4, 2023 16:53
/etc/nixos/configuration.nix

My experiments with an XMonad setup in NixOS. This is my work box now, so it pretty much works.

probably needs:

# useradd -m iain
# passwd iain ...
# passwd root ...
@stevenharman
stevenharman / _angularjs_and_rails_asset_pipeline.md
Last active April 30, 2016 23:20
Load the Angular.js $templateCache while building assets for Rails Asset Pipeline. Be sure in require the `templates` module as a dependency of your Angular.js app.

AngularJS + Rails Asset Pipeline

This is my hand-rolled solution for getting Angular assets (Controllers, Models, Directives, Templates, etc.) integrated into the Rails Asset Pipeline.

Templates and the $templateCache

Of particular note: this hack will also load the AngularJS $templateCache with your templates, while allowing you to use Slim, ERB, etc. to write your templates.

#!/usr/bin/env bash
if [ $# -eq 0 ]; then
printf 1 "Usage: $(basename $0) [build-args [-- run-args [-- cmd-args] ] ]"
printf 1 " NOTE!!! the -rm-flag is hardcoded for build!"
fi
BUILD_ARG=()
RUN_ARG=()
CMD_ARG=()
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Keymap: The Laye r in QWERTY
*
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | FN1 | | FN2 | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
@lucabrunox
lucabrunox / autotools.nix
Last active December 19, 2018 02:38
Nix pill 10
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};
@joefiorini
joefiorini / rails.nix
Created September 18, 2014 06:16
Nix Expression for Running Rails Apps
with (import <nixpkgs> {});
stdenv.mkDerivation {
name = "717-app";
buildInputs = [ libiconv openssl ruby21 postgresql git nodejs ];
src = "/src/717";
builder = builtins.toFile "builder.sh" ''
set -e
source $stdenv/setup
@mlanett
mlanett / rails http status codes
Last active May 3, 2024 04:15
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@hdeshev
hdeshev / .ctags-css
Last active May 4, 2017 17:01
ctags extras
--langdef=css
--langmap=css:.css
--langmap=css:+.scss
--langmap=css:+.sass
--langmap=css:+.styl
--langmap=css:+.less
--regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
@terenceponce
terenceponce / profile_management_spec.rb
Last active July 13, 2020 02:22
Creating Signed Cookies in Capybara
# spec/features/profile_management_spec.rb
require 'rails_helper'
feature 'Profile Management', type: :feature do
given!(:user) { create(:user) }
scenario 'User updates profile' do
cookie = SignedCookieGenerator.new(:auth, user.id)
page.driver.browser.set_cookie(cookie.to_s)
@edolstra
edolstra / nix-ui.md
Last active February 2, 2024 23:31
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.