Skip to content

Instantly share code, notes, and snippets.

/*
* TNGrowl.j
*
* Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
...
[_tableViewNetworks setUsesAlternatingRowBackgroundColors:YES];
[_tableViewNetworks setAutoresizingMask: CPViewWidthSizable | CPViewHeightSizable];
[_tableViewNetworks setAllowsColumnResizing:YES];
[_tableViewNetworks setAllowsEmptySelection:YES];
[_tableViewNetworks setTarget:self];
[_tableViewNetworks setDoubleAction:@selector(editNetwork:)];
[_tableViewNetworks setDataSource:_datasourceNetworks];
[_tableViewNetworks setDelegate:self];
#!/usr/bin/python
'''
Python WebSocket library with support for "wss://" encryption.
You can make a cert/key with openssl using:
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
as taken from http://docs.python.org/dev/library/ssl.html#certificates
Original code from Kanaka (Joel Martin).
init
_chartViewDisk = [[LPPieChartView alloc] initWithFrame:diskViewFrame];
[_chartViewDisk setDrawView:[[TNPieChartDrawView alloc] init]];
[viewGraphDisk addSubview:_chartViewDisk];
subclass
@implementation TNPieChartDrawView : LPPieChartDrawView
/*
* TNToolbar.j
*
* Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
make[3]: Entering directory `/usr/local/src/libvirt/tools'
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
/bin/sh ../libtool --mode=install /usr/bin/install -c virsh '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/virsh /usr/local/bin/virsh
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
/usr/bin/install -c virt-xml-validate virt-pki-validate '/usr/local/bin'
mkdir -p /usr/local/etc/rc.d/init.d
/usr/bin/install -c libvirt-guests.init \
/usr/local/etc/rc.d/init.d/libvirt-guests
mkdir -p /usr/local/etc/sysconfig
- (void)showActiveView
{
var centerX = [[[CPApp mainWindow] contentView] frame].size.width / 2,
centerY = [[[CPApp mainWindow] contentView] frame].size.height / 2,
frameTo = [activeView frame],
frameFrom;
frameTo.origin.x = centerX - (frameTo.size.width / 2);
frameTo.origin.y = centerY - (frameTo.size.height / 2);
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation CPTabView (TEST)
- (CPSegmentedControl)tabs
{
return tabs;
function Controller(element)
{
this.element = element;
this.foo = "bar";
this.element.addEventListener('click', this.mouseClick);
}
Controller.prototype.mouseClick = function(event)
{
- (void)init
{
if (self = [super init])
{
// ...
_toolbarSelection = [[CPImageView alloc] initWithFrame:CPRectMake(0,0,46,57)];
[_toolbarSelection setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin];
[_toolbarSelection setBackgroundColor:[CPColor blueColor]];
// ...
}