Skip to content

Instantly share code, notes, and snippets.

View omerio's full-sized avatar

Omer Dawelbeit omerio

View GitHub Profile
@omerio
omerio / index.html
Created March 2, 2022 16:05 — forked from chrisvfritz/index.html
Simplest possible HTML template
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
@omerio
omerio / mobile-browser-detect
Created June 5, 2019 16:00 — forked from braddown/mobile-browser-detect
Link for App Download - Mobile OS Detection and Redirect Download Link to Appropriate App Store
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Redirect</title>
<script type="text/javascript"> // <![CDATA[
//iPhone Version:
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
window.location = "http://goo.gl/IWd7J";
}
@omerio
omerio / deployment.yml
Created May 28, 2019 11:07 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@omerio
omerio / Jenkinsfile
Created March 16, 2019 17:34 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@omerio
omerio / Polymorph.java
Created August 14, 2018 17:55 — forked from christophercurrie/Polymorph.java
Example of Polymorphic Deserialization using Jackson
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value=AudioAttachment.class, name="audio"),
@JsonSubTypes.Type(value=LinkAttachment.class, name="link")
<!DOCTYPE html>
<html>
<head>
<title>Chatroom</title>
<!-- Step 2 Start -->
<style>
body {
padding: 100px;
}
<!DOCTYPE html>
<html>
<head>
<title>Chatroom</title>
<!-- Step 2 Start -->
<style>
body {
padding: 100px;
}
<!DOCTYPE html>
<html>
<head>
<title>Chatroom</title>
</head>
<body>
<div id="room"></div>
<textarea id="message"></textarea>
@omerio
omerio / *.md
Created April 17, 2017 16:35
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
@omerio
omerio / index.js
Created March 6, 2017 03:07 — forked from kpdecker/index.js
Hapi error handling cases
var Hapi = require('hapi');
// Create a server with a host, port, and options
var server = new Hapi.Server('localhost', 8001);
server.route([
{
path: '/failure',
method: 'GET',
config: {