Skip to content

Instantly share code, notes, and snippets.

@ahallora
ahallora / badges.html
Created February 6, 2017 09:27
App Store Badges
<!-- found on https://jawbone.com/up -->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="0">
<symbol id="microsoft-store-badge" viewBox="0 0 210 72"><title>Microsoft Store badge</title><rect width="210" height="72" rx="8" ry="8"></rect><rect x="16" y="14.93" width="20.29" height="20.29" style="fill:#f25022"></rect><rect x="38.41" y="14.93" width="20.29" height="20.29" style="fill:#7fba00"></rect><rect x="16" y="37.33" width="20.29" height="20.29" style="fill:#00a4ef"></rect><rect x="38.41" y="37.33" width="20.29" height="20.29" style="fill:#ffb900"></rect><path d="M97.84,37.8a2,2,0,0,1,.65-1.5,2.2,2.2,0,0,1,1.55-.61,2.17,2.17,0,0,1,1.59.62,2,2,0,0,1,.63,1.49,1.94,1.94,0,0,1-.64,1.48,2.22,2.22,0,0,1-1.57.6,2.19,2.19,0,0,1-1.56-.6,2,2,0,0,1-.64-1.47m4,19.83H98.21V42.24h3.62V57.63Z" style="fill:#fff"></path><path d="M112.82,55a5,5,0,0,0,1.78-.37,7.52,7.52,0,0,0,1.8-1V57a7.26,7.26,0,0,1-2,.75A10.7,10.7,0,0,1,112,58a7.32,7.32,0,0,1-7.65-7.63,8.78,8.78,0,0,1,2.17-6.11,7.86,7.86,0,0,1,6.15-2.4,8.42
@ahallora
ahallora / Rearranger.html
Last active November 16, 2016 07:06
Rearrange List with smooth-sliding animations
<h1>Rearrange List with smooth-sliding animations</h1>
<p>Click on the tiles to randomly make them move among each other with a smooth 3D-like effect. Transitions are hardware accelerated with CSS3 and accompanied with under the hood DOM-manipulation.</p>
<p>Author: Anders Holm-Jensen, allora.dk - License: MIT</p>
<ul id="list">
<li>Anders And</li>
<li>Andersine And</li>
<li>Joakim von And</li>
<li>Fætter Højben</li>
<li>Rip, rap og Rup</li>
</ul>
@ahallora
ahallora / Horizontal scroller.html
Created November 15, 2016 11:02
Horizontal scrolling area (iOS inertia style) with just CSS
<!-- Source: https://benfrain.com/horizontal-scrolling-area-css-overflow-ios/ -->
<div class="outer">
<div class="wrapper">
<a href="" class="internal">item 1</a>
<a href="" class="internal">item 2</a>
<a href="" class="internal">item 3</a>
<a href="" class="internal">item 4</a>
<a href="" class="internal">item 5</a>
<a href="" class="internal">item 6</a>
@ahallora
ahallora / input masking.html
Last active November 7, 2016 11:20
Input Masking
<!--
Author: Anders Holm-Jensen @ 7-NOV-2016
License: MIT
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.slim.js" integrity="sha256-5i/mQ300M779N2OVDrl16lbohwXNUdzL/R2aVUXyXWA=" crossorigin="anonymous"></script>
<h4>Input Masking</h4>
<input type="text" class="datamasked-input" data-maskgroup="partygroup" data-masklength="6" value="" onclick="alert('yes, we made it! Now join ' + this.value);" />
<script type="text/javascript">
@ahallora
ahallora / test.html
Created November 4, 2016 12:24
Ractive test: Change object across "ractives"
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ractive/0.8.4/ractive.min.js" integrity="sha256-heXunjNkqBw9mc4urNeQE1t8qZRu4c8jSqjhE7c45BU=" crossorigin="anonymous"></script>
<h1>Ractive test</h1>
<div style="float: left; width: 50%; background-color: #eee;" id="placeholderOne"></div>
<div style="float: left; width: 50%; background-color: #ddd;" id="placeholderTwo"></div>
@ahallora
ahallora / animation.html
Created October 30, 2016 19:59
PNG Sprite Animation with CSS
<style type="text/css">
.pngAnimation {
background: url(../assets/img/ourdio-sprite-png.png) no-repeat left top;
background-size: 2900%; /* 28+1 steps * 100% */
height: 50px;
width: 50px;
animation: o-burst 1000ms steps(28) infinite;
}
@ahallora
ahallora / readme.rmd
Created March 30, 2016 13:12
How to make SSL work on Microsoft Azure
##How to make SSL work on Microsoft Azure
##### Microsoft Azure requires a password-protected PFX file (containing the public key for your domain including any and all intermediate CA certs) in order to support HTTPS (TLS - SSL) support on your Azure hosted websites. Here's how to get it working with certificates from GeoTrust / RapidSSL (and others too probably).
__1) Create CSR__
Create a CSR-file and private key with OpenSSL and upload it to your CA:
```
openssl req -new -nodes -keyout yourprivatekey.key -out server.csr -newkey rsa:2048
```
@ahallora
ahallora / Click Rate Limiter.html
Created February 16, 2016 10:19
A simple Click Rate Limiter / Debouncer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
</head>
<body>
<ul id="list"></ul>
<button id="thebutton">Try me</button>
@ahallora
ahallora / script.js
Last active July 3, 2022 05:00
Validate Spotify Playlist HTTP and URI
/*
* Script to validate Spotify playlist HTTP and URI's
* Valid format: http://open.spotify.com/user/__username__/playlist/__playlistID__
* spotify:user:__username__:playlist:__playlistID__
*
* License: MIT
*/
function validateSpotifyPlaylistHTTPandURI(input) {
isValid = false;
@ahallora
ahallora / executesql.js
Last active August 29, 2015 14:17
PDO with MS-SQL (Azure) and Node.js
// -------------------------------------------------------------------------
// USING MSSQL NPM AND PREPARED STATEMENTS IN NODE.JS
// ENABLING ? AS PLACEHOLDERS IN SQL AND AUTOMATIC TYPECASTING OF PARAMETERS
// THIS IS WORKING ON AZURE WITH NODE.JS AND MSSQL NODE MODULE - YAII :)
// -------------------------------------------------------------------------
// MIT LICENSE 2015 @ Anders Holm-Jensen
// -------------------------------------------------------------------------
var sql = require('mssql');
var config = {