This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
var WebSocketServer = require('ws').Server; | |
var wss = new WebSocketServer({port: 8080}); | |
var jwt = require('jsonwebtoken'); | |
/** | |
The way I like to work with 'ws' is to convert everything to an event if possible. | |
**/ | |
function toEvent (message) { | |
try { |
<?php | |
// Server file | |
class PushNotifications { | |
// (Android)API access key from Google API's Console. | |
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
// (iOS) Private key's passphrase. | |
private static $passphrase = 'joashp'; | |
// (Windows Phone 8) The name of our push channel. | |
private static $channelName = "joashp"; |
/* | |
* Created by C.J. Kimberlin | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2019 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
#!/bin/sh | |
# block torrent traffic by iptable/firewall for VPN/Proxy server | |
# me@tartan.pro | |
# Delete all existing rules | |
iptables -F | |
# Set default chain policies | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP |
#!/usr/bin/env ruby | |
# What is this for? | |
# This script fixes an issue appeared for some Xcode users where it would show long identifiers | |
# in the list of simulators instead of usual short names. This is caused by duplicate simulators | |
# being sometimes created after switching between Xcode versions, with the same | |
# device type + runtime pair occurring more than once in your list of available simulators. | |
# Instead of showing the same simulator name twice, Xcode defaults to simulator identifiers. | |
# | |
# What it does? |
protocol NibInstantiatable { | |
static var NibName: String { get } | |
} | |
extension NibInstantiatable { | |
static var NibName: String { return String(Self) } | |
static func instantiate() -> Self { | |
return instantiateWithName(NibName) |
/** | |
* @param {string} str | |
* @return {boolean} | |
*/ | |
var repeatedSubstringPattern = function(str) { | |
var result = false; | |
var sameCount = 1; | |
for (var i=1; i<str.length; i++) { | |
if (str[i] === str[0]) { |
Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.