Quick Tip: Even Quicker Markup with Sparkup -
Might be useful…
dirpy studios - youtube ripper
Eric Meyer’s list of resources for vendor-prefixed CSS properties.
First you write code that doesn’t pass tests, then you write code that (barely) passes, and finally you write code that stops smoking pot, graduates with honor and you’re sitting there in the front row all dressed up like “oh shit, now I’m crying”.
The municipality of Vellinge, close to Malmö where I live, has the slogan “Vellinge - where the freedom is a little greater”. That got me thinking.
I once read a letter, from a distant relative living in the U.S. She wrote a little bit about her first impressions of coming there, a few years back.
Here are a few sentences she wrote, as I remember them, translated to English:
“I long for swedish bread, proper rye bread with real taste. The only thing I find here is white bread, and it’s awful and tasteless.”
“They say this is the land of freedom, but it mostly seems to be the freedom to throw your garbage in the middle of the street, without regards for anyone else.”
Now, the thing is, the letter was written quite some time ago. Around 1875, if I remember correctly. She was one of around 1.3 million swedes who emigrated to the U.S. because of harsh living conditions, religious intolerance and many other reasons, during the late 1800’s and early 1900’s. My mother is into genealogy research and has a treasure of letters from my ancestors, writing eloquently and vividly about their lives and hardships in the new land.
The first sentence made me chuckle; both of them made me think that some things aren’t that much different today from what they were then. One of the things that is different is Sweden. We’ve become a fairly rich nation since then, and hopefully a much more pleasant place to live.
Still, intolerance is alive and well here. Recently, there’s been the debacle about Vellinge, and the placing of a home for lone refugee children there. Vellinge is famous for two things: being ranked as one of the most desirable places to live in Sweden, and for their governing right-wing politicians taking a hardline approach to taking care of refugees: they want no part of it. In all fairness, they’re not alone among the municipalities of this country to take that stance, but they are the figurehead of that stance, and geographically the one closest to me.
The question of paying for the care of the children is not even an issue: it’s the city of Malmö taking care of that, and the caretaking is outsourced to a private company, as I’ve understood the matter. Malmö just doesn’t have enough housing for the number of children currently seeking asylum, arriving alone, without any family to take care of them.
So the only thing that the municipality of Vellinge has taken a stance on is that they don’t want immigrant children in their town. And it’s not just some deranged decision of a handful of grumpy politicians: the ruling Moderate party received around 60 percent of the votes in the latest election, and for a public town meeting regarding the placing of this halfway house for children, so many people showed up that they had to move the meeting to a bigger venue. According to the local paper, Sydsvenskan, pretty much all of the attendees were strongly against the plans, and local politicians loudly proclaimed to do their best to stop it.
“What about our children”, someone apparently said at the meeting, “what will happen when they meet the foreign kids in the street?”. Yes, so noble of them to think of the children. “They’ll bring crime and disorder, and some of them are probably almost adults, close to 18 years old!”. Oh, I’m sorry, I didn’t know that it was a house for juvenile criminals, I thought it was refugees. “This will bring the value of our houses down!” - Bingo.
There is no real concern for the “swedish” children of Vellinge in these statements. There is just fear against that which is different, and inability and unwillingness to understand that which is problematic and harder to understand than the rules of, say, golf. It’s just racism.
Now, about freedom. As I stated in the beginning of this post, the slogan for Vellinge translates in English to “Vellinge - where the freedom is a little greater”. It seems to me that it’s mostly the freedom to not see people from a different background, with different and perhaps more painful experiences in their life, pass by your golf course. It’s freedom without regard for anyone else, and it doesn’t leave room for the freedom of others. It’s white bread, devoid of any real substance. It leaves a bad taste in my mouth.
Django-lint - Statically check Django applications -
Now this looks really handy! An app for checking your django project against a set of rules/conventions/sensible coding practises, to help ensure good performance, avoid problems in the future and…
I use TextMate a lot when doing web development, and I absolutely love it. Some of my friends and colleagues also use TextMate, and I get questions like “what was that thing you did with the thing with the text” sometimes. Here, I thought I would document some of the ones I use most frequently.
To create a tag without having to type those pesky angle-brackets and other thingamabobs, there are a few ways to go about it. First, if you find that you already opened the tag “manually”, you can always close a tag by pressing ⌘ (cmd), ⌥ (alt) and “.”. Secondly, you can open a pair of opening and closing tags by using ctrl and “<”. That gives you a default tag of “<p></p>”, which you can then either just change into whatever you want by typing the tag name, and the closing tag automatically changes, or you can tab into the middle if you’re happy with creating a p-tag (same goes for when you have changed it, press tab to jump into the tag).
This way of creating a tag pair allows you to type in attributes before tabbing into creating the content of the element. There is a second way to use this command, and that is to type the name of the tag first (like for instance “li”) and then hit ctrl and “<”, that will give you opening and closing tags and the cursor placed inside straight away.
If you already have a piece of content (a line of text or other HTML elements) that you need to wrap in a pair of tags, you can use ctrl, ⇧ (shift) and “w”. Too bad it doesn’t reindent your code for you, but you can’t win all the time…
Speaking of wrapping stuff, one really useful command when wrapping text with “<a>”-tags is to use ctrl, ⇧(shift) and “L”. That means the text you selected becomes a link, and as an added bonus, the contents of your clipboard gets inserted as the value of the href-attribute. Pretty handy, eh? When I create dummy links on a page, I just copy a hash-character (#) and then just zoom through the text, adding links where necessary. You can also use the same command without selecting text, which gives you an empty “<a>”-tag, then just tab into entering the link text when you’re done with the attributes.
TextMate also has the lovely quality of being able to select text over specific columns as well as multiple lines. This means you can make a selection of a specific part of multiple lines and enter text into this spot on all lines, simultaneously. The easiest way of doing this is to hold the ⌥ (alt) key while selecting an area with the mouse. Try creating a few lines of empty space, select a column across all lines and type “<li><a href=”#”>List item</a></li>” - Hey presto, a list with multiple dummy items in one fell swoop! If you’re not a mouse user, you can enter this multiple-row-editing mode by creating a few empty lines, selecting them (by holding ⇧ (shift) and using the arrow keys) and then pressing ⌘ (cmd) + ⌥ (alt) + “a”.
There’s also an abunance of element-specific commands to use. When creating a new HTML document, you can either use one of the templates that ship with TextMate, but if you prefer to do everything “by hand”, try typing for example “doctype” followed by pressing tab (and then hit the number key for the option you want), or why not “head” + tab? There are too many of these to go through, but apart from the above mentioned “doctype” and “head” shortcuts, try tabbing after typing “form” or “table”. That gives you some default scaffolding instead of the tedious work of typing out everything in these elements by hand.
When editing CSS, I don’t use as many shortcuts, I find that they mostly slow me down. A couple of things worth noting is that most properties can be tab-completed, if you’re unsure of spelling or syntax. Try typing “background” followed by a tab, for example: that will give you a couple of choices for background properties.
One thing that is quite handy, though, is the built in math bundle: you can do calculations of measurements inline! Say that you’re trying to calculate the em-size of a particular piece of text, and you want it to harmonize with the vertical rythm of the page. You need a line height of 18px for text set in 14px, in ems. Just type “line-height: 18/14em;”, select the “18/14” part and press ctrl + ⇧ + “C”, which gives you a couple of options for calculating a value. Choose “evaluate and replace expression” (no. 2) and you’re good to go!
Finally, it’s also worth mentioning in this context that all of the defaults for what happens for a specific command is easily customized via Bundle Editor, accessed via Bundles - Bundle Editor - Show Bundle Editor (there’s even a keyboard shortcut for that: ⌘ + ⌥ + ctrl + “B”).
Happy coding!
ZURB – Super Awesome Buttons with CSS3 and RGBA -
An article written by Mark Otto titled ‘Super Awesome Buttons with CSS3 and RGBA’.