Skip to content

Instantly share code, notes, and snippets.

View surfjedi's full-sized avatar
🤪

Lee Blazek surfjedi

🤪
View GitHub Profile
@surfjedi
surfjedi / exportOptionsAdHoc.plist
Created September 15, 2023 18:20 — forked from cocoaNib/exportOptionsAdHoc.plist
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
@surfjedi
surfjedi / gist:7fdf4da41897dc7bc8e1773eeccc5c1e
Created March 2, 2018 16:56 — forked from danilop/gist:d4ff43835e469043e95e
Amazon S3 redirection rule to send every "miss" (HTTP 404) to the domain root
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>danilop.net</HostName>
<ReplaceKeyWith/>
</Redirect>
</RoutingRule>
@surfjedi
surfjedi / 0-desc.md
Last active August 29, 2015 14:09 — forked from bajtos/0-desc.md

Imagine a chat server persisting the messages, a simplified Slack chat. The domain is designed in the object-orientated style. In order to get realtime updates, we need to transport events emitted on the model constructor ("static" events) and on a model instance ("instance" events).

While it may not be immediately clear, the example is covering few other important LoopBack concepts too:

  • authorization (loopback.token in REST)
  • current context (loopback.context in REST)

What is not covered:

  • file uploads and downloads
@surfjedi
surfjedi / good.js
Created October 10, 2013 10:14 — forked from chrisckchang/good.js
var express = require('express');
var mongodb = require('mongodb');
var logger = require('./logger.js');
var app = express();
var MONGODB_URI = 'mongodb-uri'
var db;
var coll;
// Initialize connection once, reuse the database object
@surfjedi
surfjedi / ios_detect.coffee
Created September 19, 2012 02:11 — forked from rboyd/ios_detect.coffee
Detect iPhone user agent, offer app download, and javascript redirect to iTunes App Store
OFFER = 'We have an app available in the App Store! Download now?'
ITUNES_URL = '<Your iTunes URL Here>'
createCookie = (name,value,days) ->
if days
date = new Date()
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 365))
expires = '; expires=' + date.toGMTString()
else
expires = ''