Skip to content

Instantly share code, notes, and snippets.

#http://ubuntuforums.org/showthread.php?t=786095
sudo aptitude install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
cd ~/tmp
git clone git://git.videolan.org/x264.git
cd x264
./configure
make -j2
#!/bin/sh
# install scrot pwgen xsel
# your dropbox account number goes here
DROPBOX=1788721
FILENAME=$HOME'/Dropbox/Public/screenshots/%Y%m%d-%H%M%S-screenshot-'`pwgen -1`'.png'
scrot -s $FILENAME -e 'curl "http://is.gd/api.php?longurl=http://dl.dropbox.com/u/'$DROPBOX'/screenshots/"$n' 2>/dev/null | xsel -i -b
// Binding to URL
HonVotes = new Recource({ url: 'http://domain.com/prefix/hon/votes' });
// Default jQuery callbacks
Comments = new Resource({
url: 'http://domain.com/prefix/comments'
//dataType: 'json',
beforeSend: function(){},
// Example:
//
// Posts = new Resource({url: 'http://localhost:3000/posts', model: 'post'});
//
// Posts.create({
// title: 'hey!',
// body: 'post!'
// }).send({
// success: function(){ alert('!') }
// });
= menu :class => "navigation" do |m|
- if logged_in?
- m.item t("menu.my_articles"), workspace_path
- m.item t("menu.events"), events_path
- m.spacer
- if current_user.accepted?
- m.item t("menu.articles"), articles_path, /articles$/
- m.item t("menu.users"), users_path
- m.spacer
- m.item t("menu.documents"), publications_path(:filter => 'documents')
$.extend(obj, (function(){
function private_function(){...}
function private_function2(){...}
return {
public_function: function() {...},
public_function2: function() {...}
}
%% index comments
handle(HD, get, {comments}, Req) ->
[CommentableId, CommentableType] = commentable_params(Req),
Result = case ut:all_defined([CommentableType, CommentableId]) of
true ->
Key = {CommentableType, CommentableId},
case cache:get(commentable_cache, Key) of
token = "DQAAAJMAAAD6eA_yqsc...KsqsmQ3SmntxMtAaWg9jO_OJvJNCXkfhBtfp"
ga = Gattica.new(
:token => token,
:headers => {'Authorization' => "GoogleLogin auth=#{token}"},
:profile_id = 4689690
)
res = ga.get(
:start_date => '2010-05-18',
#!/usr/bin/env ruby
def to_time(h, m)
day, month, year = Time.now.to_a[3..5]
Time.mktime(year, month, day, h.to_i > 23 ? 0 : h, m).to_i
end
summ = 0
Dir['*.txt'].each do |file_name|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ru-RU"
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
</head>