Skip to content

Instantly share code, notes, and snippets.

View certainty's full-sized avatar
🏠
Working from home

David Krentzlin certainty

🏠
Working from home
View GitHub Profile
module CryptoProvider
class EncryptionFailure < RuntimeError
end
class DecryptionFailure < RuntimeError
end
class Base
def initialize(key_provider)
@key_provider = key_provider
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-layout-window-sizes nil)
'(ecb-options-version "2.40")
'(ecb-source-path (quote (("/your_path" "Dev"))))
'(global-font-lock-mode t nil (font-lock))
'(inhibit-startup-screen t)
@certainty
certainty / gist:4123649
Created November 21, 2012 07:43
03_ido.el
(require 'ido-ubiquitous)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(setq ido-create-new-buffer 'always)
(ido-mode 1)
@certainty
certainty / gist:4123602
Created November 21, 2012 07:32
01_base.el
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; bindings that affect all modes
;; Align your code in a pretty way.
(global-set-key (kbd "C-x \\") 'align-regexp)
@certainty
certainty / gist:4123555
Created November 21, 2012 07:19
10_ecb.el
(setq stack-trace-on-error t)
(require 'ecb)
(ecb-activate)
(ecb-byte-compile)
@certainty
certainty / gist:4123554
Created November 21, 2012 07:19
00_init.el
(when window-system
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
(tooltip-mode -1)
(mouse-wheel-mode t)
(blink-cursor-mode -1))
(defun disable-toolbar ()
(if window-system
(tool-bar-mode 0)))
@certainty
certainty / test_spec.rb
Created November 20, 2012 13:27
hmm if that helps?
module RequestHelper
def speak_friend_and_enter(user,password = "#{user}_password")
visit new_user_session_url
fill_in "user[email]", with: user
fill_in "user[password]", with: password
click_button "Anmelden"
end
end
shared_examples "foo" do |a,args|
it "is true" do
true.should be_true
end
end
describe "some context" do
def self.user
:user
/**
* @class Ext.omcx.I18N.PackedObject
*
*/
Ext.extend(Ext.omcx.I18N.PackedObject,Ext.util.Observable,{
/**
* Lookup the object stored under the given key
* @methodOf Ext.omcx.I18N.PackedObject
* @param {String} key
* @params default_value Will be returned if no entry can be found for key
@certainty
certainty / gist:3885785
Created October 13, 2012 19:06
dynamic attr
class Module
def dynamic_attr(*names)
attr_accessor *names
names.each do |name|
define_method("with_#{name}") do |new_value,&blk|
begin
old_value = __send__(name)
__send__("#{name}=",new_value)
blk.call(self)
ensure