I figured I would post this since I only found one place that ever talked about it. I was doing includes in PHP with query string on them. This necessitates including the file with the full URL (http://domain.tld/script.php?foo=foo1&bar=bar1). However, when including something with the full URL, sessions in the included file do not work anymore. This gave me fits for about two days before I found this out. I got around it by passing the variables into the included file another way (due to the way I am doing my templating), but you could probably just include the file after setting the variables, as the included file will read those variables from the including file.
Wezzul.com - It's the Dinglez
Home >> Posts Tagged With: programming
This one took me a minute to figure out, but I'm happy I did. To create a new skin from the filesystem, and add your own layers to it (or in this case, add the layers from Plone Default), do the following:
Pretty straight forward, right? In any case, it is helping me immensely with the current project.
#use this to get the skins directory
ps = getToolByName(self,'portal_skins')
# use this to add a new folder to that directory for your new skin
ps.manage_addFolder(skin_id, skin_id)
newSkinFolder = getattr(ps, skin_id)
path = newSkinFolder.absolute_url()
# get a set of tuples of all skins
paths = ps.getSkinPaths()
# these lines get the layers from Plone Default
defPath = paths[0]
defPath = defPath[1]
# add your new folder to the top of the Plone Default layers
defPath = skin_id "," defPath
# add the skin to the properties of portal_skins
ps.addSkinSelection(skin_id, defPath, 0, 0)
ps = getToolByName(self,'portal_skins')
# use this to add a new folder to that directory for your new skin
ps.manage_addFolder(skin_id, skin_id)
newSkinFolder = getattr(ps, skin_id)
path = newSkinFolder.absolute_url()
# get a set of tuples of all skins
paths = ps.getSkinPaths()
# these lines get the layers from Plone Default
defPath = paths[0]
defPath = defPath[1]
# add your new folder to the top of the Plone Default layers
defPath = skin_id "," defPath
# add the skin to the properties of portal_skins
ps.addSkinSelection(skin_id, defPath, 0, 0)
Pretty straight forward, right? In any case, it is helping me immensely with the current project.
Lin_ger is an IRC bot I wrote using the Net::IRC libraries in perl. Lin_ger can do the following:
- Play Hangman
- Give the weather
- Log all channel chat
- Op users
- Message information from http://4q.cc
- Display a random quote from the database.
My README for Lin_ger is pretty sparsely populated, I expect to have a better one up in the near future. However, I am putting the bot up for download.
Download Lin_ger IRC Bot 0.1.0 Here
Update:
Download Lin_ger IRC Bot 0.1.1 Here
Current Music:
Radiohead - Everything in it's Right Place
- Play Hangman
- Give the weather
- Log all channel chat
- Op users
- Message information from http://4q.cc
- Display a random quote from the database.
My README for Lin_ger is pretty sparsely populated, I expect to have a better one up in the near future. However, I am putting the bot up for download.
Download Lin_ger IRC Bot 0.1.0 Here
Update:
Download Lin_ger IRC Bot 0.1.1 Here
Current Music:
Radiohead - Everything in it's Right PlaceI created a plugin for Quod Libet 0.23 that writes song data to a mysql database. Readme is included in the download, gives information about configuration of plugin.
Download dbIt 0.20 for Quod Libet
Current Music:
Tokyo Ska Paradise Orchestra - Taiyou Ni Onegai
Download dbIt 0.20 for Quod Libet
Current Music:
Tokyo Ska Paradise Orchestra - Taiyou Ni OnegaiFixed the rippr to count pages in accordance with the total # of images displayed on the front photos page of a user. This is done by taking that number, and dividing by the median # of images per page, 18. This provides a within-a-page accuracy. This was necessary because of flickr's updates.
Download Flickr Rippr 1.0.1 here
Download Flickr Rippr 1.0.1 here
Since learning some perl, I've realized it has great applications for automatically ripping data from webpages. So I wrote something for flickr to take a users album, rip all the pages out of it and then pull all the full sized images from those pages.
In the archive, there are three files. The perl script, rippr.pl, a users.txt file, and a records.txt file. All that needs to be done is populating the users.txt file with user directories in the format http://www.flickr.com/photos/username. You will also need to create a directory, images, as a subdirectory of the directory where the perl script resides. Then, while running the script, it will create a new directory in images for each user, and pop the images in there, naming them incrementally with numbers so as not to have duplicate image names.
It has worked pretty well for me so far, and it's relatively fast as well. Get it here.
Edit: I upped a new copy that pulls down the original images instead of the sized ones flickr displays by default.
Current Music:
The Raconteurs - Steady as She Goes
In the archive, there are three files. The perl script, rippr.pl, a users.txt file, and a records.txt file. All that needs to be done is populating the users.txt file with user directories in the format http://www.flickr.com/photos/username. You will also need to create a directory, images, as a subdirectory of the directory where the perl script resides. Then, while running the script, it will create a new directory in images for each user, and pop the images in there, naming them incrementally with numbers so as not to have duplicate image names.
It has worked pretty well for me so far, and it's relatively fast as well. Get it here.
Edit: I upped a new copy that pulls down the original images instead of the sized ones flickr displays by default.
Current Music:
The Raconteurs - Steady as She GoesLast 20 Links into site from Google.com:
resetting a wps54g
It's the caffeine%2C the nicotine%2C the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car.
It's the caffeine%2C the nicotine%2C the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car.
"It's the caffeine, the nicotine, the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car. lyrics
WPS54G print server default ip
sundowner cd four one five two torrent
wps54g reset ip address
"And i gotta get outta here" lyrics
how to reset Linksys print server
slax sucks
ubuntu use two videocards
laugh now cry later cursuve
xbmc lircd configuration
davey's makeup
flick downloader
reset linksys wireless print server
linksys live chat
irc bot users.txt
perl image downloader
linksys reset command line
resetting a wps54g
It's the caffeine%2C the nicotine%2C the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car.
It's the caffeine%2C the nicotine%2C the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car.
"It's the caffeine, the nicotine, the milligrams of tar. It's my habitat. It needs to be cleaned. It's my car. lyrics
WPS54G print server default ip
sundowner cd four one five two torrent
wps54g reset ip address
"And i gotta get outta here" lyrics
how to reset Linksys print server
slax sucks
ubuntu use two videocards
laugh now cry later cursuve
xbmc lircd configuration
davey's makeup
flick downloader
reset linksys wireless print server
linksys live chat
irc bot users.txt
perl image downloader
linksys reset command line
