Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
example: a method on a model that outputs a list of tuples with (attribute_name.verbose, attribute_value)
0
1200
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
886
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
1306
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
1102
posted 15 years ago by magicrebirth
How to get actual category name in wordpress if is_category() is true
0
919
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
1648
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
960
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
1212
posted 15 years ago by ginoplusio
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
1067
posted 15 years ago by mpontus