Skip to content

Instantly share code, notes, and snippets.

View jonlunsford's full-sized avatar
⌨️
Hacking

Jon Lunsford jonlunsford

⌨️
Hacking
View GitHub Profile
/*
* Simple javascript mobile OS / iphone/ android detector
*
* License: GPLv3+
* Author: justin.kelly.org.au
*
*/
$(document).ready(function() {
var deviceIphone = "iphone";
@jonlunsford
jonlunsford / detect_mobile_devices.html
Created August 29, 2012 16:19 — forked from kamenov/detect_mobile_devices.html
How to detect mobile devices on your site :)
var isMobile = function() {
var mobile = (/iphone|ipad|ipod|iemobile|android|meego|nokia|blackberry|mini|symbian|windows\sce|palm/gi.test(navigator.userAgent.toLowerCase()));
if (mobile) return true;
}
@jonlunsford
jonlunsford / CKEditor_config
Created November 14, 2014 19:12
CKEditor config
{
"customConfig":"config.js",
"autoUpdateElement":true,
"language":"",
"defaultLanguage":"en",
"contentsLangDirection":"",
"enterMode":1,
"forceEnterMode":false,
"shiftEnterMode":2,
"docType":"<!DOCTYPE html>",
defmodule Citrusbyte do
@moduledoc """
This module contains custom Citrusbyte implementations of native functions,
For fun and profit.
All unit tests are in the form of doctests.
"""
@doc """
Flattens multi dimensional arrays.
@jonlunsford
jonlunsford / test.md
Created July 14, 2017 23:14
test from vim

Test Gist from VIM

mix new messenger --sup
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:gen_smtp, "~> 0.11.0"}
]
end
config :messenger, smtp_opts: [[port: 2525]]
defmodule Messenger do
use Application
def start(_type, _args) do
Messenger.Supervisor.start_link(name: Messenger.Supervisor)
end
end
defmodule Messenger.Supervisor do
use Supervisor
def start_link(opts) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
def init(:ok) do
children = [
worker(:gen_smtp_server, [Messenger.Server, Application.get_env(:messenger, :smtp_opts)])