Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am eudaimonious on github.
  • I am eudaimonious (https://keybase.io/eudaimonious) on keybase.
  • I have a public key ASA4Dn5x1xZls-hSgvmZLTHnhLTwsAzJ6q_iIhvHkMi68Qo

To claim this, I am signing this object:

git log --no-merges --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
class A(object):
@property
def x(self):
return self._x
@x.setter
def x(self, value):
self._x = value
class B(A):
@A.x.getter
@eudaimonious
eudaimonious / intelliJ
Created June 24, 2014 18:55
IntelliJ Tips
To easily evaluate the value of any expression while debugging the program, select its text in the editor (you may press a ⌘W a few times to efficiently perform this operation) and press ⌥F8.
Full Keyboard Symbol List:
⌘ is command

⌥ is option

⌃ is control

⇧ is shift

⇪ is caps lock

← is left arrow

→ is right arrow

↑ is up arrow

↓ is down arrow

count=0
function once(fn) {
var new_function = function(){
//var has_been_called = false;
//call original if count is < 1
console.log("I am in the if statement");
count++;
console.log("I am counting: " + count);
if (count > 1) {return undefined}
@eudaimonious
eudaimonious / ClassCreatesObject.py
Created January 31, 2014 22:14
A class method that takes another object as an argument and returns a new object. From http://interactivepython.org/runestone/static/pyladies/Classes/classesintro.html
class Point:
def __init__(self, initX, initY):
self.x = initX
self.y = initY
def getX(self):
return self.x
import math
class Point:
""" Point class for representing and manipulating x,y coordinates. """
def __init__(self, initX, initY):
self.x = initX
self.y = initY
def getX(self):
return self.x
@eudaimonious
eudaimonious / git
Created January 13, 2014 18:16
Merge and squash, stash alternative, delete branches, rebase
// Squash commits into a new branch before merging
git co staging && git pull
git co -b <similar topic name, e.g. topic-pr>
git merge --squash <original topic branch>
git add .
git commit -m "REP-123: Story title"
git push <similar topic name>
// Go to GitHub issue my pr
@eudaimonious
eudaimonious / controller.rb
Created December 18, 2013 15:48
No need to nest. Since a user can only see her/his own lists and tasks, you don't have to nest these resources. Define them separately in your routes file and retrieve the current user from your authentication framework.
class ListsController < ApplicationController
def index
@lists = current_user.lists
end
end