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
@TyrfingMjolnir
TyrfingMjolnir / main.swift
Created December 4, 2016 23:53
swift REST API basic skeleton
$ cat main.swift
import Kitura
import HeliumLogger
// Initialize HeliumLogger
HeliumLogger.use()
// Create a new router
let router = Router()
func setupItem( router: Router ) {
router.post( "/:id" ) {
let myJSON = JSON( ["HTTP _POST item id": id] )
response.status( 200 ).send( json: myJSON )
next()
}
router.get( "/:id" ) {
let myJSON = JSON( ["HTTP _GET item id ": id] )
response.status( 200 ).send( json: myJSON ) }
next()
//
// 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)
# FileMaker CWP
server {
  listen 0.0.0.0:8080;
  location / {
    proxy_pass http://127.0.0.1:80;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  }
@TyrfingMjolnir
TyrfingMjolnir / opt_artifacts_sn17kvmwindows2k16.json
Created September 28, 2017 07:43
Joyent SmartOS KVM zone file for Windows 2016 Server
{
"brand": "kvm",
"alias": "w2k16",
"cpu_type": "Nehalem",
"vcpus": 1,
"autoboot": false,
"ram": 16384,
"resolvers": ["10.0.0.10","208.67.222.222","208.67.220.220"],
"disks": [
{
@TyrfingMjolnir
TyrfingMjolnir / dehydratedQuickstart
Created October 23, 2017 13:23
dehydrated Quickstart
cd /opt
git clone https://github.com/lukas2511/dehydrated
cd dehydrated
sudo mkdir -p /usr/local/etc/dehydrated
sudo mkdir -p /var/www/dehydrated
cp docs/examples/config /usr/local/etc/dehydrated
vim /usr/local/etc/dehydrated/config
echo "domain.tld mail.domain.tld www.domain.tld ws.domain.tld api.domain.tld" > /usr/local/etc/dehydrated/domains.txt
Make sure /var/www/dehydrated is exposed publicly as this is the temp folder used for validation; \
@TyrfingMjolnir
TyrfingMjolnir / cli-nsrunloop.m
Created January 2, 2018 15:25 — forked from syzdek/cli-nsrunloop.m
Creating an NSRunLoop for a command line utility.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSRunLoop * runLoop;
CLIMain * main; // replace with desired class
@autoreleasepool
{
// create run loop
@TyrfingMjolnir
TyrfingMjolnir / nmap-build-TomSellers.sh
Last active January 30, 2018 20:54 — forked from syzdek/mmap-build-TomSellers.sh
Simple build script to build TomSellers' nmap repository
#!/bin/bash
echo "building TomSellers's nmap..."
set -x -e
pwd
git clone https://github.com/TomSellers/nmap.git
( cd nmap && git branch build 7c833b933e771923e660 && checkout build )
( cd nmap && ./configure --prefix=/opt/nmap )
( cd nmap/libdnet-stripped && make )
( cd nmap/liblinear && make )
@TyrfingMjolnir
TyrfingMjolnir / FileMaker 16 Insert Other Symbol all alternatives
Last active January 6, 2018 10:54
FileMaker 16 Insert Other Symbol all alternatives copy of this list: http://www.filemaker.com/help/16/fmp/en/index.html#page/FMP_Help%2Fget-functions.html%23wwconnect_header when you paste this file into a text block in FileMaker please remember to set the tab accordingly.
/*
FileMaker 16 Insert Other Symbol all alternatives is a copy of the following table:
http://www.filemaker.com/help/16/fmp/en/index.html#page/FMP_Help%2Fget-functions.html%23wwconnect_header
when you paste this file into a text block in FileMaker please remember to set the tab accordingly.
1) Select text block
2) Open inspector
3) Go to appearance( the palette icon ), close all the sections apart from the bottom one in which is named tab,
add a tab; for me 2 and 6 cm was reasonable.