Welcome To Snipplr


Everyone's Recent Snippets



1 ... 348 349 350 351 352 ... 553
0 1178 posted 15 years ago by magicrebirth
0 1119 posted 15 years ago by magicrebirth
0 1180 posted 15 years ago by magicrebirth
example: a method on a model that outputs a list of tuples with (attribute_name.verbose, attribute_value)
0 3307 posted 15 years ago by magicrebirth
create a dictionary from the data in two lists
0 1351 posted 15 years ago by magicrebirth
// Is there a way in python to convert a list say [1,2,3,4] to a string and // also how to convert a string to a list? // use str() or repr() to convert to a string. // eval() will convert back to a list.
0 1106 posted 15 years ago by magicrebirth
0 958 posted 15 years ago by magicrebirth
1 971 posted 15 years ago by magicrebirth
First: create a file under djangoapp/templatetags where you define your tags [e.g.: myadmin_tags.py]: Second: create the html snippets that get loaded in those tags [e.g., personfactoid_info.html]: Third: in mytemplates/admin/ modify change_for...
1 1542 posted 15 years ago by magicrebirth
This function takes anything which can be dumped into JSON and returns an HTTP response of it, with the right Content-type header.
2 3205 posted 15 years ago by magicrebirth
How to get actual category name in wordpress if is_category() is true
0 1128 posted 15 years ago by AlessandroCoscia
This script will return the URL for the current page you're on, including category and tag pages.
3 2292 posted 15 years ago by jonhenshaw
How to access the build number in the WAR file (generated by the Maven build number plugin) from Java.
0 1165 posted 15 years ago by ff1959
I’ve made this class that can use normal session variables, or cookies. This class can use cookies in two ways: store a single variable in each cookie, or pack many variables, encrypt, and store them into cookies. Now I always use this class whe...
2 1415 posted 15 years ago by ginoplusio
1 1153 posted 15 years ago by ReeceMarsland
0 1193 posted 15 years ago by ff1959
I written this code to parse apache log in common log formats. It may have problems with irresponsible formatting like non-concluded into quotes request line. I welcome any modifications to my snippet because it was written if short time and this is...
0 1297 posted 15 years ago by mpontus
0 1396 posted 15 years ago by ReeceMarsland
Read a file from the FileSystem
0 1100 posted 15 years ago by allnatural
1 ... 348 349 350 351 352 ... 553