This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- MODAL BOX --> | |
<section class="modal"> | |
<a class="close">×</a> | |
<h2>New mail</h2> | |
<form action="" id="new-mail" method="POST"> | |
<div class="floats"> | |
<label for="from">From (your e-mail address)</label> | |
<input id="from" type="email" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def next_message(messages) | |
begin | |
debugger | |
message = messages.queued.next | |
date = message.arrived_at | |
rescue NoMethodError => e | |
date = nil | |
message = new_message_path | |
end | |
date = date ? " in #{time_ago_in_words(date)}" : "when you write one!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@message = Message.new(params[:message]) | |
if @message.save | |
if session[:sent] | |
@messages = current_user.messages.sent.arrived_at_asc.paginate(:page => params[:page], :per_page => 5) | |
else | |
@messages = current_user.messages.queued.created_at_desc.paginate(:page => params[:page], :per_page => 5) | |
end | |
flash[:success] = "Mail is successfully queued and will be sent on #{@message.arrived_at}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav> | |
<ul> | |
<?php $class = 'class="current"';?> | |
<li <?php if(is_page("about") echo $class; ?>><a href="<?php link_to("about");?>">About</a></li> | |
</ul> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sips -s format png /Applications/Safari.app/Contents/Resources/compass.icns --out /Users/Johan/Desktop/safari.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"SELECT DISTINCT MONTH( post_date ) AS month , | |
YEAR( post_date ) AS year, | |
COUNT( id ) as post_count FROM $wpdb->posts | |
WHERE post_status = 'publish' and post_date <= now( ) | |
and post_type = 'post' | |
GROUP BY month , year | |
ORDER BY post_date DESC" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is the default style of Kod. If you wish to modify this to your liking, | |
* make a copy and put it in ~/.kod/mystyle.css then tell Kod where to find it | |
* by setting a configuration key: | |
* | |
* $ defaults write se.hunch.kod style/url ~/.kod/mystyle.css | |
* | |
* You might need to restart Kod for changes to take effect. Then, simply open | |
* your ~/.kod/mystyle.css in Kod -- when edited and saved Kod will | |
* automatically reload the style, thus you see the effect of your alterations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
& > section{ | |
float: left; | |
margin-right: $lineheight; | |
width: $wideColumn; | |
background: transparent url(style/images/frontpage-icons.png) no-repeat left top; | |
padding-top: $column; | |
@for $i from 2 through 4 { | |
&:nth-child(#{$i}){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
/** | |
* A simple jQuery I wrote to truncate long links (in the post footers, amongst others). | |
* | |
* Usage: | |
* $("a.long-links").truncate( [ {limit: 40, truncationText: "..."} ] ); | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @rem's solution | |
$(document).ready(function () { | |
var $comment = $('#comment'), | |
top = $comment.offset().top - parseFloat($comment.css('marginTop').replace(/auto/, 0)), | |
$window = $(window); | |
$window.scroll(function (event) { | |
// what the y position of the scroll is |
OlderNewer