Friday, February 12th, 2010
switching
I am going back to my old blog. My contract with this site should run out about anytime now. And I don't have funds to renew it.
1:44pm by Brandon //comment 478 views Wednesday, October 7th, 2009
Jquery Comments
I just can't say this enough. jQuery is AWESOME. I had a comment system in a django blog, which has supervisors and above moderate operator comments. With 37 lines of javascript (including comments and organizational line breaks) I was able to moderate the comments inline as shown here:
Inline Comment Moderation
Here is the jquery:
$(document).ready(function(){
change_links('');
});
//found this in some forum. it works for what i need, but is it good?
$.fn.unwrap = function(expr) {
return this.each(function(){
$(this).parents(expr).eq(0).after(this).remove();
});
};
function moderate_click(link){
var comment = link.closest('.comment');
comment.slideUp();
var id = comment.attr('id');
//get publish or remove
var actionurl = link.attr('href');
$.get(actionurl,function(data){
comment.wrap("<div id='one_time_use'></div>");
$('#one_time_use').html(data);
$('#'+id).unwrap("div");
change_links('#'+id);
$('#'+id).slideDown();
});
}
function change_links(param){
//the param gets the comments to change links
//ie either "" or the commentid
$(param + ' .moderate_links a').click(function(){
moderate_click($(this));
return false;
});
}
and here is the important part of the django view:
#this part is in both publish and remove views
if request.is_ajax():
return ajax_comment(request,comment,redirect)
#this is the ajax_comment function
def ajax_comment(request,comment,redirect):
if redirect.find('/bulletins/comments/') != -1:
blogslug = 'comments'
else:
blogslug = ''
return render_to_response('bulletins/comment.html',{
'comment':comment,
'user':request.user,
'blogslug':blogslug,
'is_ajax':True,
})
a call to those more experienced: is this good? is there a way to do this in only 10 lines of code? since i'm mostly teaching myself, i can only go on the basis of "It works!"
11:09am by Brandon //comment 1013 views Monday, October 5th, 2009
Best Complete Sentence Ever
"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo."
Essentially say "People I hate hate other people."
Now describe the people. "Maine people I hate hate other Maine people."
Now I'm not the only one, and I'm from Maine. "Maine people Maine people hate hate Maine people."
Now replace the descriptors with Buffalo (the place as an adjective of position), the people with buffalo (as in herd of), and the action with buffalo (the verb meaning: to bully).
"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo."
wikipedia on this sentence.
2:16pm by Brandon //comment 564 views Thursday, October 1st, 2009
Screentoaster.com
This is a fantastic tool.
screentoaster.com
You sign up, the browser loads a java applet, and before you know it you can record in full screen or in a rectangular section. Perfect for showing friends, coworkers, and grandma how set up her gmail account.
the best part about it is that it's entirely web-based and incredibly user friendly. you click a button or alt-s to start and pause recording, then after clicking "stop recording" you have the option to upload to youtube, upload straight to screentoaster (which gets through my work's internet filter as opposed to youtube), or create a .mov file.
have fun with it. i bookmarked it immediately.
12:35am by Brandon //comment 508 views Wednesday, April 1st, 2009
Thank you Linux Mint!!!
I have a wireless card with an atheros chipset; therefore, connecting to wireless with Linux distributions can be a super pain in the ears (ears was the suggested spelling in Firefox when I typed 'arse,' and I thought ears was more funny).
however...
tonight, for the first time, I have been able to connect to wifi with WPA2 encryption using a Linux distribution. Before now, I was able to get fedora, ubuntu, puppy, eeZos, debian, and xubuntu to connect to wireless, but without encryption (and even some of them had WEP). My wireless network uses WPA2, so I was never satisfied with any of the distributions.
Tonight I completed an installation on my laptop of Linux which connected exactly the way I wanted it. All this time I've been searching for answers, and finally they have come. Linux Mint!
Linux Mint has two simple steps to get your Atheros Chipset Wireless Cards working on your Lenovo ThinkPads (there have been reports of some Atheros Chipset Wireless Cards on other computers, but not on Lenovo ThinkPads).
the two steps are as follows:
#go to windows wireless drivers
menu->administration->windows wireless drivers #(all the way at the bottom)
#next click +Install New Driver
#browse to location
/usr/lib/linuxmint/mintWifi/drivers/i386/Atheros_* (or your driver here)
Not only that, but I have put this all onto a USB pen drive. There are multiple bonuses here:
- No matter what computer I am using, all of my settings will be the same.
- I can use linux at work without having to change any of my work computers.
- The dorkness meter is through the roof.
the above actually assumes that any computer that I use is able to boot from USB, but in theory, if it doesn't have a usb port, it likely has a floppy drive, so you could make a boot floppy to find the usb drive. there goes that dork meter again.
I was able to put the entire distribution, plus WINE and django and a couple other applications on a 2gb kingston usb drive, so being greedy, I sprung for an 8gb sandisk usb drive (a whopping $19.97--and you KNOW you can get them dirt cheap online). mind you linux mint already comes with open office (an entire suite of ms office replacement tools--as if anyone reading this wouldn't know that already), the GIMP, Thunderbird, Firefox, Python, and a multitude of other programs.
So much power. So little space.
Anyway I hope that works for anyone at all. If you are helped, let me know. I'm curious as to whether or not I should do more of these types of posts, or if everyone already knows this and I'm just the shop kid. Either way, I'm so giddy right now. I'm going to restart and make absolutely sure this newest distribution will be persistent, so i can spend all night updating and configuring.
11:55pm by Brandon //3 comments 1202 views Saturday, February 14th, 2009
Coupons
Why do they make coupons have a cash value of one hundredth of a cent?
To whom can I sell 1 million coupons for 100 dollars? Any takers? Talk about return on investment!
11:34am by Brandon //comment 474 views Thursday, December 18th, 2008
Tax Season
I can't wait for my W2s. I worked for the entire year this time. More than half of it was making more money than I ever did before. Hopefully I still qualify to get it all back since Nellnet and Sallie Mae rape my wallet so much. Starting in January, my 401k kicks in, so I'll see a tiny bit of a pay decrease. Although I am probably looking at a promotion. What that entails I do not know.
I began the design of my new project at work. I like it more than any of the stuff I've done for personal use. That seems to be happening lately, but I think I can attribute it to getting better at what I do. Which is a good thing.
PS. I'm really glad to finally get that music video off the first page of my blog. I saw 168 or so views on the last post, which means other people are probably glad too.
10:14pm by Brandon //2 comments 935 views