Skip to content

Instantly share code, notes, and snippets.

@richleland
richleland / desired.sql
Last active August 29, 2015 13:57
How can I do a search and replace in vim that will replace everything between "this as that" and "from", regardless of the number of columns being selected in between?
select
this as that,
*
from
table_name
select
this as that,
*
from

Keybase proof

I hereby claim:

  • I am richleland on github.
  • I am richleland (https://keybase.io/richleland) on keybase.
  • I have a public key whose fingerprint is 3607 B152 BDE5 85EC 8E75 6841 8C3B 8696 6178 F2F2

To claim this, I am signing this object:

# git aliases
alias gb="git branch"
alias gba="git branch -a"
alias gc="git commit -v"
alias gd="git diff | mate"
alias gl="git pull"
alias gp="git push"
alias gst="git status"
<script Language="JavaScript" type="text/javascript">
<!--
var curDateTime = new Date();
var tzoffset = "-" + (curDateTime.getTimezoneOffset()/60);
var expiredate = new Date();
expiredate.setTime(expiredate.getTime()+(120*24*60*60*1000)); // set expire date to 120 from now
if (-4 != tzoffset) {
document.cookie = "mlsfinder_tz="+tzoffset+";expires="+expiredate.toGMTString();
}
NSString *boolString(BOOL yesNO)
{
if(yesNo == NO) {
return (@"NO");
} else {
return (@"YES");
}
}
django-fowler
django-stream
django-flux
django-perpetua
django-breeze
django-fluid
django-current
django-tide
django-loop
django-circle
# put this in yr model
def admin_edit_link(self):
return '<a href="/admin/%s/%s/%s/">%s</a>' % (self._meta.app_label,
self._meta.module_name,
self.id,
self.__unicode__())
content_title.allow_tags = True
def content_title(self):
return '<a href="/admin/%s/%s/%s/">%s</a>' % (self.content_object._meta.app_label,
self.content_object._meta.module_name,
self.content_object.id,
self.__unicode__())
content_title.allow_tags = True
We couldn’t find that file to show.
# fix dumb apple aslmanager memory leak
alias fixasl="sudo launchctl stop com.apple.syslogd; sudo launchctl stop com.apple.aslmanager; rm -rf ~/Desktop/temp/; mkdir ~/Desktop/temp; sudo mv /var/log/asl/* ~/Desktop/temp/; sudo launchctl start com.apple.syslogd; rm -rf ~/Desktop/temp/;"