Skip to content

Instantly share code, notes, and snippets.

View ryszard's full-sized avatar

Ric (Ryszard) Szopa ryszard

View GitHub Profile
script type="text/javascript">
window.parent.callback()
</script>
<h1>It works</h1>
Process: MacBlip [92683]
Path: /Users/ryszard/Downloads/MacBlip.app/Contents/MacOS/MacBlip
Identifier: net.psionides.MacBlip
Version: ??? (0.1)
Code Type: X86-64 (Native)
Parent Process: launchd [195]
Date/Time: 2010-02-25 13:39:40.559 +0100
OS Version: Mac OS X 10.6.2 (10C540)
Report Version: 6
The existence of moral conflicts as an argument against cognitivism
==========
Introduction
I'll try to avoid logical formalism at all costs as I believe that in
this case it neither contributes to the clarity of the discourse nor
is interesting from the logical point of view.
(function () {
if (window.fluid) {
var unread = 0;
var focused = false;
window.fluid.dockBadge = "";
var orig = BLIP.updater.addUnreaded;
BLIP.updater.addUnreaded = function (a) {
orig(a);
unread += a;
>>> 'ala ma kota'.replace(' ', r'\ ')
'ala\\ ma\\ kota'
>>> list('ala ma kota'.replace(' ', r'\ '))
['a', 'l', 'a', '\\', ' ', 'm', 'a', '\\', ' ', 'k', 'o', 't', 'a']
>> array_of_long_pasted_in_strings = [<<FOO, <<BAR, <<BLATZ]
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
FOO
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
BAR
I recently discovered that I can use multiple heredocs as parameters.
Isn't that neat? Because almost nothing needs to be escaped with heredocs, I prefer to use it when strings are pasted in from elsewhere. Because the syntax for using it inside parameter lists is so nice, I prefer to use it whenever a multiline string literal is being passed into something as an argument.
BLATZ
=> ["Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu
(richard garibaldi):~/Projects/sinatra% spec trigrams_spec.rb
.F..
1)
'Trigram returns 1 when comparing identical strings' FAILED
expected: 1.0,
got: 1.0 (using ==)
/Users/richard/Projects/sinatra/trigrams_spec.rb:11:in `block (2 levels) in <top (required)>'
/opt/local/lib/ruby1.9/1.9.1/timeout.rb:44:in `timeout'
In [1]: from petitions.models import *
In [4]: sum(p.signature_set.count() for p in Petition.objects.all())
Out[4]: 1722
In [5]: sum(p.signature_set.count() for p in Petition.objects.all())
Out[5]: 1722
In [6]: from django.db import connection, transaction
url.rewrite-once = (
"^(/(media/|static/|favicon.ico|robots.txt).*)$" => "$1",
"^(/.*)$" => "main.fcgi$1",
)
class TestFlow(TestCase):
def setUp(self):
from django_sqs import queues, receiver
self.subscription = Subscription(title="Subscription")
self.subscription.save()
self.register = Register(runner_class=OnlySubscriptionRunner)
self.register(test_agent)
self.broadcast = Broadcaster(self.register.agents)
self.runner = self.register.agents.values()[0]