Skip to content

Instantly share code, notes, and snippets.

View leeola's full-sized avatar

Lee Olayvar leeola

View GitHub Profile
@leeola
leeola / README.md
Created December 11, 2022 23:13 — forked from Shou/README.md
PureRef nixpkg

PureRef nixpkg

This is a hacky appimage wrapper nixpkg for PureRef to integrate it into NixOS better. As you may know, it's donationware, so the author encourages a donation and this means there's no way around manually downloading the program. So as a prerequisite, you need to download PureRef separately and slap it in the same folder as the Nix file, or alternatively, change the path to an absolute one, e.g.

src = /home/you/Downloads/PureRef-1.11.1_x64.Appimage;

Ideally this would use the actual Nixpkg appimage build tooling... but that's effort, and I just want to get shit done right now and this works fine.

Usage

# using VirtualBox version $VBOX_VERSION
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \
app.factory 'json', ['$q', ($q) ->
name = 'henry'
service = (_name) ->
if _name? then name = _name
service
service.greet = (greeting='Hello') ->
deferred = $q.defer()
var http = require('http');
var exec = require("child_process").exec;
http.createServer(function (request, response) {
console.log('Response being generated..');
response.writeHead(200, {'Content-Type': 'text/plain'});
call_execs(response);
}).listen(8000);
68 def process_args(args, session_started):
69 ''' Fully process any arguments given. This includes reading/creating the
70 config if it is part of the arguments.
71 '''
72
73 if session_started:
74 parsed_args = parse_started_args(args)
75 else:
76 parsed_args = parse_stopped_args(args)
77
| 40 main_group.add_argument('-s', '--server', dest='server',
| 41 default='localhost',
| 42 help='Some help')
class RESTfulPOSTRequestHandler(RequestHandler):
'''A RESTful way to handle POST form data.'''
def dispatch(self, method, **kwargs):
'''Upon any POST requests this class simply looks for a "method"
field, and if found, returns the appropriate response.'''
if (method == 'post' and self.request.form.has_key('method') and
self.request.form['method']):
method = str(self.request.form['method']).lower()
return super(RESTfulPOSTRequestHandler, self).dispatch(method, **kwargs)
class RESTfulPOSTRequestHandler(RequestHandler):
'''A RESTful way to handle POST form data.'''
def dispatch(self, method, **kwargs):
'''Upon any POST requests this class simply looks for a "method"
field, and if found, returns the appropriate response.'''
if (method == 'post' and self.request.form.has_key('method') and
self.request.form['method']):
method = str(self.request.form['method']).lower()
return super(RESTfulPOSTRequestHandler, self).dispatch(method, **kwargs)
# -*- coding: utf-8 -*-
'''A slew of HTML5 focused Fields.
'''
from tipfy.ext.wtforms import Field
from tipfy.ext.wtforms.widgets import Input
class HTML5Input(Input):