Skip to content

Instantly share code, notes, and snippets.

View sevcsik's full-sized avatar

András Sevcsik-Zajácz sevcsik

View GitHub Profile
@andrevdm
andrevdm / Scotty_websockets.hs
Last active March 6, 2024 01:51
Using websockets with scotty haskell
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Protolude
import qualified Web.Scotty as Sc
import qualified Data.Text as Txt
import qualified Network.Wai.Middleware.Gzip as Sc
@Andrei-Pozolotin
Andrei-Pozolotin / maven-scala-js.md
Last active January 26, 2021 09:38
maven scala js
@dlebech
dlebech / Gerrit comment formatting
Last active January 17, 2024 10:34
Comment formatting in Gerrit
The documentation for Gerrit when it comes to formatting comments is quite lacking. Here is short list created by trial and error and looking at the source code in:
./gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtml.java
Lists:
* List item 1
* List item 2
- List item 1
- List item 2
@kenaniah
kenaniah / post-fetch.sh
Last active August 14, 2018 08:44
Git post-receive (remote push) and post-fetch (local pull) hooks for trac. Since post-fetch is not a real hook, it must be called manually after every fetch.
#!/bin/bash
# This isn't really a git hook, but it's manually called it after every fetch run.
# This script essentially wraps the actual post-receive hook.
# Build the standard input for the post-receive hook
cat refs/heads/* | paste TRAC_HEAD - > post-fetch.tmp
find refs/heads/* | paste post-fetch.tmp - | awk '{print $1, $2, $3}' > post-fetch.stdin
# Call the post-receive hook just like the commits were pushed
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created June 3, 2012 19:30
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active March 20, 2024 08:12
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"