Skip to content

Instantly share code, notes, and snippets.

View TyrfingMjolnir's full-sized avatar
💭
in my scriptorium whipping up some whoopass

Tyrfing Mjølner TyrfingMjolnir

💭
in my scriptorium whipping up some whoopass
View GitHub Profile
## Still in 2014 I'm on FM11SA and would like to know if it's possible to run this trick
## from http://www.haxney.org/2012/06/use-filemaker-web-publishing-in-apache.html
## This is just a fork, the first line at least has its file in place for FM11SA
## Used this solution for now with IIS: http://forums.filemaker.com/posts/8d17326af1
LoadModule jk_module "c:/Program Files/FileMaker/FileMaker Server/Web Publishing/publishing-engine/web-server-support/apache-2.2/mod_jk.so"
JkWorkersFile "c:/Program Files/FileMaker/FileMaker Server/Admin/admin-helper/WEB-INF/conf/workers.properties"
JkMountFile "c:/Program Files/FileMaker/FileMaker Server/Admin/admin-helper/WEB-INF/conf/uriworkermap.properties"
//FixturesObject.m
//...
NSString *dateString = [NSString stringWithFormat: @"%@",object.date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
NSDate *myDate = [dateFormatter dateFromString:dateString];
NSString *dateInEpoch = [NSString stringWithFormat:@"%.0f", [myDate timeIntervalSince1970]];
//
// FixturesController.m
// Liga Zon Sagres Companion
//
// Created by Berto Bettencourt on 2/10/2014.
// Copyright (c) 2014 Orrian. All rights reserved.
//
#import "FixturesController.h"
#import "GADBannerView.h"
var o2x = require( 'object-to-xml' );
var j2c = require( 'json-2-csv' );
var j2t = require( 'json-2-tsv' );
function( req, res, next ) {
if( req.accepts( 'application/json' ) ) {
return res.json( req.payload );
}
if( req.accepts( 'text/xml' ) ) {
res.set( 'content-type', 'text/xml' );
/**
*
* Convert Excel dates into JS date objects
* exampleInput: "42090"
* exampleOutput: "Fri Mar 27 2015 01:00:00 GMT+0100 (CET)"
*
* @param excelDate {Number}
* @return {Date}
*
*/

Share a ZFS file system over SMB/CIFS and advertise it via mDNS so that it shows up in the OS X Finder. Assumes SmartOS, but should work fine on any illumos distribution.

# Create volume
zfs create zones/store

# Allow guest access to a trusted subnet
zfs set sharesmb=rw=10.10.1.0/22,guestok=true,name=store zones/store

# Advertise the SMB service, it will now show up in Finder
@TyrfingMjolnir
TyrfingMjolnir / _INSTALL.md
Created May 4, 2016 19:23 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@TyrfingMjolnir
TyrfingMjolnir / dhcpd.conf
Created May 21, 2016 23:04 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
//
// AppDelegate.swift
// test
//
// Created by IOANNIS DELIGIANNIS on 1/2/16.
// Copyright © 2016 IOANNIS DELIGIANNIS. All rights reserved.
//
import Cocoa
@TyrfingMjolnir
TyrfingMjolnir / Playgrounds.swift
Last active February 7, 2017 07:39 — forked from SpacyRicochet/Playgrounds.swift
Snippet of the Week; Prototyping views in Playgrounds
import UIKit
import PlaygroundSupport
let thisIsNotPlayground = false
//: NSLayoutConstraint convenience methods
public extension NSLayoutConstraint {
public static func pinning(attribute: NSLayoutAttribute, ofView firstView: UIView, toView secondView: UIView, multiplier: CGFloat = 1, offset: CGFloat = 0) -> NSLayoutConstraint {
return NSLayoutConstraint(item: firstView, attribute: attribute, relatedBy: .equal, toItem: secondView, attribute: attribute, multiplier: multiplier, constant: offset)