Skip to content

Instantly share code, notes, and snippets.

View darimpulso's full-sized avatar
🏠
Working from home

Dan darimpulso

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
(function() {
// Optional Modernizer (only do this for desktop not mobile)
if (!$('html').hasClass('no-touch')) return;
var items = el.find('.container');
if (items.length) {
$window = $(window);
@darimpulso
darimpulso / gist:9780043
Created March 26, 2014 10:00
ResponsiveEl
/**
* Helper function that dynamically adds eg. gt480 class to element if it's width is >480px
*
* Basically simulates media queries for elements
*/
Kwf.Utils.ResponsiveEl = function(selector, widths)
{
var initEl;
if (typeof(widths) != "function") {
@darimpulso
darimpulso / gist:9365755
Last active April 16, 2018 20:18
Node Cluster with redis
var cluster = require("cluster")
, redis = require("redis") // Needs redis server
, os = require('os');
var cpus = os.cpus();
var workers = cpus.length || 2;
if(cluster.isMaster) {
@darimpulso
darimpulso / gist:8038372
Created December 19, 2013 12:24
rtmp nginx
rtmp {
server {
listen 1935;
ping 30s;
notify_method get;
application myapp {
live on;
# sample play/publish handlers