Skip to content

Instantly share code, notes, and snippets.

fn returnSS() -> String {
String::from_str("lala")
}
fn returnS() -> &'static str {
returnSS().as_slice()
}
fn main() {
let result = returnS();
@jagajaga
jagajaga / vim2nix.sh
Last active November 22, 2021 10:38
#!/usr/bin/env sh
# Simple script to create a buildVimPlugin drv for NixOs
# JagaJaga 2014
# Usage ./vim2nix.sh repoOwner/repoName (only github is supported)
# Deps: nix-prefetch-scripts
rep="https://github.com/"$1".git"
homepage="https://github.com/"$1
rev=$(git ls-remote "$rep" | head -1 | cut -f1)
name=$(echo "$1" | sed 's/\(.*\)\/\(.*\)/\2/g' | sed 's/vim-\(.*\)/\1/g' | sed 's/\(.*\)\.vim/\1/g')
th pkgs;
let
vimrcConfig = {
# If you like VAM use such:
vam.knownPlugins = vimPlugins; # optional
vam.pluginDictionaries = [
# load always
{name = "youcompleteme";}
];
class HasHeight a where
height :: a -> Int
data Tree = Leaf | Node {_height :: Int}
instance HasHeight Tree where
height Leaf = 0
height a = _height a
# This module defines a small NixOS installation CD. It does not
# contain any graphical stuff.
{ config, pkgs, ... }:
{
imports =
[ ./installation-cd-base.nix
../../profiles/minimal.nix
];
copying Nix to /mnt....
/nix/store/2rxy33yiij5b6b11dy9yykikdbv9ws4r-attr-2.4.47
/nix/store/341ay6yik79bg12s7svdmsahwzmi7a20-gzip-1.6
/nix/store/3fs5b4jd407pgpih5wp44wa94dqg0qw2-gcc-4.8.3
/nix/store/9zm81madq885zb1lsfxpn4rw5y4zcxqm-xz-5.0.7
/nix/store/ajv29kvr4yy1h9q6nmllvf9nvqqbcw44-libssh2-1.4.3
/nix/store/bzqcs6b5r64xf4v86m2a5pcndhv1lnab-bash-4.3-p30
/nix/store/f77zisclx8dmdibwpsvvcag7yigcdgrp-acl-2.2.52
/nix/store/gncl5zi6m46a4ql7h323bn79dpbhs2xn-zlib-1.2.8
/nix/store/grsbvhhppy9lxqggafa7ly9igzi7kv7n-sqlite-3.8.7.4
# This module defines a small NixOS installation CD. It does not
# contain any graphical stuff.
{ config, pkgs, ... }:
{
boot = {
loader.grub = {
timeout = 1;

Keybase proof

I hereby claim:

  • I am jagajaga on github.
  • I am jagajaga (https://keybase.io/jagajaga) on keybase.
  • I have a public key whose fingerprint is 497B 0787 2077 746A DD6C ED82 C4F1 31DF 7F7B 40E3

To claim this, I am signing this object:

import Control.Monad.Fix
import Data.Char
main = interact $ unlines . map (fix (\f word -> case word of
[] -> []
(x:s:xs) -> toLower x : toUpper s : f xs
xs -> xs)) . lines
module Gshell.Graphs (
) where
import Control.Applicative
import Data.Graph.Inductive hiding (mkEdges, mkNodes)
import Data.GraphViz
import Data.GraphViz.Attributes
import Data.GraphViz.Attributes.Complete
import Data.GraphViz.Printing
import Data.Text.Lazy (Text, pack, unpack)