Skip to content

Instantly share code, notes, and snippets.

View v0d1ch's full-sized avatar
:octocat:
compiling...

Sasha Bogicevic v0d1ch

:octocat:
compiling...
View GitHub Profile
@stla
stla / authaccountcustom.hs
Created September 8, 2016 13:57
Yesod Auth Account custom login page
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TemplateHaskell, OverloadedStrings #-}
{-# LANGUAGE GADTs, MultiParamTypeClasses, TypeSynonymInstances #-}
import Data.Text (Text)
import Data.ByteString (ByteString)
import Database.Persist.Sqlite
import Control.Monad.Logger (runStderrLoggingT)
import Yesod
import Yesod.Auth
@cies
cies / .spacemacs
Created September 13, 2015 12:44
My .spacemacs when trying to get a full features Haskell setup that is stack-aware
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@wallace7souza
wallace7souza / gist:a1897a7ba8280ebbfee2
Created September 1, 2015 03:24
Angularjs formly angucomplete type
formlyConfig.setType({
name: 'angucomplete-remote',
//template: '<input show-weeks="false" class="form-control" min-date="to.minDate" ng-model="model[options.key]" is-open="to.isOpen" datepicker-options="to.datepickerOptions" />',
template: '<angucomplete-alt id="{{to.id}}" placeholder="{{to.placeholder}}" pause="{{to.pause}}" selected-object="model[options.key]" remote-url="'+endpoint+'{{to.url}}" '+
'description-field="{{to.label}}" search-fields="{{to.searchField}}" text-no-results="{{to.textNoResults}}" input-class="form-control form-control-small" title-field="{{to.titleField}}" match-class="{{to.matchClass}}" text-searching="{{to.textSearching}}"/>',
//templateUrl: 'datepicker.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError'],
defaultOptions: {
ngModelAttrs: ngModelAttrs,
templateOptions: {
#!/usr/bin/env bash
if [ "$#" -ge 2 ]
then
DBNAME="$1"; shift
PREFIX="$1"; shift
else
echo "usage: mysql-dump-like.sh <database> <table_prefix> [<mysql_options...>]"
exit 1
fi
@krdlab
krdlab / start-yesod.sh
Created February 21, 2015 10:36
Start yesod (use cabal sandbox)
wget http://www.stackage.org/lts/cabal.config
cabal update
cabal sandbox init
cabal install alex happy yesod-bin
export PATH=./.cabal-sandbox/bin:$PATH
yesod init --bare
cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals
yesod devel
@codyburleson
codyburleson / dust-replace-helper.js
Created October 24, 2014 03:32
String replace helper for Dustjs
(function (dust) {
/**
* Polyfill to create String.trim() if it's not natively available
*/
if (!String.prototype.trim) {
(function(){
// Make sure we trim BOM and NBSP
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function () {
@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@borisguery
borisguery / wssetoken.php
Created September 27, 2012 08:19
WsseToken generator for curl
#!/usr/bin/env php
<?php
function wsse_header($username, $password) {
$nonce = hash_hmac('sha512', uniqid(null, true), uniqid(), true);
$created = new DateTime('now', new DateTimezone('UTC'));
$created = $created->format(DateTime::ISO8601);
$digest = sha1($nonce.$created.$password, true);
return sprintf(
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 28, 2024 16:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname