Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivo Dancet caifara

View GitHub Profile
View pull_request
#!/bin/zsh
# abort if git status is not clean
gs=$(git status)
clean_status="nothing to commit"
if test "${gs#*$clean_status}" != $gs;
then
echo "Git clean, continuing ..."
else
echo "Git status not clean! Cleanup first!"
@caifara
caifara / uitleg.md
Last active Nov 12, 2017
raspberry pixel OS
View uitleg.md

Installeren op USB stick

  • schijfhulpprogramma
  • wis als guid partitie en MS dos fat
  • iso erop plaatsen met prog "Etcher"

Boot

  • stick in comp
  • option ingedrukt houden bij starten
@caifara
caifara / upgrade postgres.txt
Last active Apr 25, 2016
upgrading postgres
View upgrade postgres.txt
# originally installed through official "visual installer"
# 1 install new version with same visual installer
# 2 stop server
$> sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-9.1.plist
# 3 ease passwordcontrol
# Edit pg_hba.conf in old and new server, example:
View hash_mogelijkheden.rb
aantal_letters = 26.to_f # aantal letters in alfabet
aantal_cijfers = 10.to_f # aantal cijfers mogelijk
aantal_karakters = "b6e72be89c731f42be9dfd724b37312355a9f9ca".length
# Het totaal aantal mogelijke combinaties die je kunt bouwen zoals
# b6e72be89c731f42be9dfd724b37312355a9f9ca is gelijk aan:
#
mogelijkheden = (aantal_letters+aantal_cijfers)**aantal_karakters
# (** betekent tot de zoveelste macht)
# (hierboven staat dus (26+10)^40)
View reports.rb
require 'active_support/concern'
module WorkingYear::Reports
extend ActiveSupport::Concern
def reminders(number)
options = {
:allow_generate => @working_year.current?(:generate_reminders)
}
View .gvimrc.local
fu! ToggleFullScreen()
if &fullscreen == 1
set guioptions+=e
else
set guioptions-=e
endif
set invfu
endfu
View templates.js
(function(){
window.JST = window.JST || {};
window.JST['users/_show'] = Haml('.user\n %h1= name\n = email\n');
window.JST['boats/_show'] = Haml('.boat\n %h1= name\n');
})();
View assets.yml
template_extension: jst.haml
template_function: Haml
javascripts:
lib:
- public/javascripts/lib/rails.js
- public/javascripts/lib/underscore-min.js
- public/javascripts/lib/backbone-min.js
- public/javascripts/lib/haml.js
View .bash_profile
# add this to your bash_profile
alias vimroom="mvim -S ~/.focus.vim"
View slime.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function Send_to_Screen(text)
if !exists("g:slime")
call Screen_Vars()
end
let escaped_text = substitute(shellescape(a:text), "\\\\\n", "\n", "g")
call system("screen -S " . g:slime["sessionname"] . " -p " . g:slime["windowname"] . " -X stuff " . escaped_text)