Skip to content

Instantly share code, notes, and snippets.

View drager's full-sized avatar
🦀
🦀 🕸️

Jesper Håkansson drager

🦀
🦀 🕸️
View GitHub Profile
split p [] = ([],[])
split p (x:xs) = if p x then (x : ys, zs)
else (ys, x : zs)
where (ys, zs) = split p xs
isEven :: Int -> Bool
isEven number = number `mod` 2 == 0
'use strict';
const path = require('path');
const webpack = require('webpack');
const production = process.env.NODE_ENV === 'production';
const babelPlugins = ['jsx-tagclass'];
const babelProdPlugins = babelPlugins.concat(
['transform-react-constant-elements', 'transform-react-inline-elements']

Case 1

match(10) {
  w < 10 => print('x is less than 10');
  x > 10 => print('x is greater than 10');
  10 => print('x is equal to 10');
}

![mshang](data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAC2CAYAAADneMKmAAALiklEQVR4Xu2dbWxVRRrH/32hLS9tgSywsBXSBgJoVqhAERsDFpC0NhaISl3i+qGQsIhfMEujEKsJqIlm3f2gUbAE0qwQNRZJNcUaFiVCG0qh9SUUsbAlsBQo0IaW21LanTmXe3sutL333Dtzzpy5z5D7pcx5Zp7/b55z58ydZ05MHyugopUCMQRVK56GMwRVP6YEVUOmBJWg6qiAhj7RdypB1VABDV2iSCWoGiqgoUsUqQRVQwU0dIkilaBqqICGLlGkElT1Fbh8Gbh9G4iPB8aPZ79YxKjfZ9E91CZS6+qAF14Afv21X6LkZKC0FHjmmeiCqwXUc+eA9HQvzDfeAB59FPjlF+CVV7x/27ULePFF0fGgrj0toH76KbB6NfDDD8Djj/eL/dNPwMMPA089BXz1FRAXpy4IkT3TAupLLwFffAGcPg2kpgbKw/+vshKorwdGjRIpnbq2tIC6cydQVAQUFgLFxcD06cDw4eqKLrtnWkC9csX7PdrU1C/X0qVAfj6wZAnw4IOyZVTLvhZQuaQ9PcDRo0BVlfdTXd0v9LZtwGuvqSW8zN5oAbW9HRgxwvts6ittbcCRI8CGDd4I5rPhaIlY10Pt6PDOcBcvBrZvv3/8f/458NxzwLFjwNy5MuNDHduuh+rxAPPnA5cuAT/+CEydGijuO+8Ar77qnf1y+NFQXA+VQ9q3D1ixwouLryDNnu2F/NlnwO7dQHY2cOhQ4O1ZZ7haQOWAKiq8jzV87ddc+CPOpk3A2LE6Ywz0TRuo3K3ubuD8ee+C/rBhwIQJ0bPgYMaqFdToicWhPSWoGo4EgkpQNVRAQ5e0itRU9hNNO19eAvoKCwtj2AcFBQUaYtP8O9UE0vA0JSXFALtnzx7s3bsXBw4cYL/eFBqfZcuWRQVgV0bqQCDb+GLv3RLDNib5Tj3wsCUnDpd/ampq/IA

"scripts": {
"postinstall": "tsd install",
"start": "npm run build && npm run packager",
"build": "npm-run-all build:*",
"build:typescript": "tsconfig && tsc",
"build:babel": "babel .tmp/ts --out-dir dist",
"lint": "npm-run-all lint:*",
"lint:typescript": "tslint `find app -name '*.ts?'`",
"packager": "node_modules/react-native/packager/packager.sh --skipflow --root dist",
"tsconfig": "tsconfig"
from django.contrib.auth.models import User
from django.core.management.base import NoArgsCommand
from django.utils.timezone import now
class Command(NoArgsCommand):
help = "Delete inactive users that has a expired activation key."
def handle(self, **options):
User.objects.filter(is_active=False, userprofile__key_expires__lte=now()).delete()
(py34dj17)$ python manage.py test functional_tests
Creating test database for alias 'default'...
E
======================================================================
ERROR: test_can_login_via_oauth (functional_tests.test_login_via_oauth.LoginViaOauthTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/drager/toerh/functional_tests/test_login_via_oauth.py", line 7, in test_can_login_via_oauth
self.login()

Packages for meteor applications

  • Meteor Core
    • standard-app-packages
  • Routing
    • iron:router
    • zimme:iron-router-active
  • UI and UX
    • fastclick
  • meteorhacks:fast-render

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.

# -*- coding: utf-8 -*-
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse
from notifications import notify
def notify_topic_subscribers(post):
topic = post.topic
for user in topic.subscribers.all():