Skip to content

Instantly share code, notes, and snippets.

View schaary's full-sized avatar

Michael Schaarschmidt schaary

  • Halle (Saale), Germany
View GitHub Profile
@schaary
schaary / doom.txt
Created February 28, 2021 21:36 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@schaary
schaary / for_loop_postgresql.sql
Last active December 17, 2019 07:23
for loop to fetch records from select in postgresql
-- An implicite cursor in PostgreSQL PLPGSQL.
--
-- The main idea is to declare a cursor in the loop header
-- and fetch the rows inside the loop
do $$
declare
rec record;
begin
for rec in
@schaary
schaary / phoenix_to_umbrella
Created June 8, 2019 10:28 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@schaary
schaary / create_mysql_dump.sh
Last active May 14, 2019 08:45
create mysql dump
#!/usr/bin/env bash
# Dieses Script schreibt einen Dump der Datenbank, die als erstes Argument
# übergeben wird.
# Die Dumps sind umfassend - d.h. sie kommen mit einem `create database` und
# vollständingen `create table` Statements, damit man ein Backup von allen
# Einstellungen bzgl. Collation und Character Set hat.
if [ -z ${1} ]
@schaary
schaary / install-ripgrep-on-ubuntu.sh
Created March 23, 2019 10:48 — forked from kostaz/install-ripgrep-on-ubuntu.sh
Install ripgrep on Ubuntu
#!/bin/bash
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; }
REPO="https://github.com/BurntSushi/ripgrep/releases/download/"
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name)
RELEASE="${RG_LATEST}/ripgrep-${RG_LATEST}-x86_64-unknown-linux-musl.tar.gz"
TMPDIR=$(mktemp -d)
cd $TMPDIR
wget -O - ${REPO}${RELEASE} | tar zxf - --strip-component=1
@schaary
schaary / spacemacs-keybindings
Created October 24, 2018 21:12 — forked from adham90/spacemacs-keybindings
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
Select resources_assign.*
FROM resources_assign
LEFT JOIN termine ON (termine.termin_id = resources_assign.`assign_user_id`)
LEFT JOIN auth_user_md5 ON (auth_user_md5.user_id = resources_assign.`assign_user_id`)
WHERE auth_user_md5.user_id IS NULL
AND termine.termin_id IS NULL
@schaary
schaary / install-ecs-gems.md
Last active November 30, 2015 08:43
Installation und Start von unicorn für ecs

Vorbereitungen: Installation von build-essential, git-core, und rbenv

    # als root einloggen
    $ sudo -s
    # aktuelle Version von git
    $ add-apt-repository ppa:git-core/ppa
    $ apt-get update
    $ apt-get install build-essential git-core
apt-get update
apt-get upgrade
apt-get install software-properties-common python-software-properties
add-apt-repository -y ppa:ubuntu-elisp/ppa
add-apt-repository -y ppa:fish-shell/release-2
add-apt-repository -y ppa:git-core/ppa
add-apt-repository -y ppa:nginx/stable
add-apt-repository -y ppa:mizuno-as/silversearcher-ag
@schaary
schaary / search_result.exs
Created May 19, 2015 09:25
ldap search result example in elixir using eldap
{:ok,
{:eldap_search_result,
[{:eldap_entry, 'uid=elvis,ou=mail,o=abc,c=de',
[{'uid', ['elvis']}, {'mail', ['elvis@example.com']},
{'givenName', ['Elvis Aaron']}, {'cn', ['Elvis Aaron Presley']},
{'carLicense', ['1a2b3c']}, {'sn', ['Presley']}]}], []}}