Skip to content

Instantly share code, notes, and snippets.

View ruffrey's full-sized avatar
🥦

Jeff P ruffrey

🥦
View GitHub Profile
@leedm777
leedm777 / WebRTC-Standards.md
Last active December 4, 2015 19:52
If you start digging into WebRTC, here's all the stuff you'll run into
@chadxz
chadxz / Chrome 46 WebRTC Renegotiation Issues.md
Last active December 16, 2015 15:39
Chrome 46 WebRTC Renegotiation Issues

Chrome 46 WebRTC Renegotiation Issues

The below SDP is recreated using the following steps:

  • Participant A offers audio+video to Participant B
  • B answers with audio+video
  • Call connected.
  • A renegotiates to remove audio, making it a video-only call from it's side
    • calls getUserMedia with { audio: false, video: true }
  • removes all streams from the peer connection, and adds the stream from getUserMedia
@ruffrey
ruffrey / events-list.html
Last active December 19, 2015 00:19
Example events list which displays event time period. From bootstrap-calendar (tmpls): https://github.com/Serhioromano/bootstrap-calendar
<span class="hide" id="cal-slide-tick"></span>
<div id="cal-slide-content">
<ul class="unstyled">
<% _.each(events, function(event){ %>
<li>
<span class="pull-left event <%= $(event).data('event-class') %>"></span>&nbsp;
<a href="<%= $(event).attr('href') %>" target="_blank"
data-event-id="<%= $(event).data('event-id') %>"
data-event-class="<%= $(event).data('event-class') %>"
class="event-item">
@scottnix
scottnix / gist:10430003
Last active August 14, 2016 04:38
Gulpfile.js Sample, latest
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
markdown = require('gulp-markdown'),
@raykendo
raykendo / ArcGIS-JSAPI-MapClickByQueryHack.md
Last active July 6, 2018 20:29
ArcGIS-JSAPI: Clicking on a webmap without clicking on a webmap

Clicking on a map without clicking on a map

An ArcGIS JavaScript API hack

Purpose: I have a map application with a list of results from a query. When I click on one of the items in the result list, I wanted the map to zoom to the associated feature, and trigger a click that shows the result in a popup.

Library: ArcGIS JavaScript API

Version: tested on versions 3.9-3.13.

@zimmicz
zimmicz / server.js
Created August 6, 2017 16:25
PostGIS MVT Express routing
const express = require("express")
const app = express()
const { Pool } = require("pg")
const SphericalMercator = require("sphericalmercator")
const pool = new Pool({
host: "localhost",
port: 15432,
user: "postgres",
database: "postgres"
})
@derekseymour
derekseymour / freshdesk_sso.js
Last active June 17, 2020 15:59
Freshdesk Single Sign On URL - Node.js
var crypto = require('crypto');
/**
* Generates and returns a Freshdesk Single Sign On URL
* {@link https://gist.github.com/derekseymour/26a6fe573c1274642976 Gist}
*
* @author Derek Seymour <derek@rocketideas.com>
* @param {String} name - The name of the user logging in.
* @param {String} email - A valid email address to associate with the user.
@jedi4ever
jedi4ever / Compiling_Nodejs_Single_File.md
Last active October 10, 2020 15:12
Notes on compiling/packaging a node.js projects as a single binary

Compiling plain javascript (no external modules)

So we got nexe to compile nodejs projects to an executable binary:

  • it downloads the nodejs source
  • it creates a single file nodejs source (using sardines )
  • it monkey patches the nodejs code to include this single file in the binary (adding it to the lib/nexe.js)

$ nexe -i myproject.js -o myproject.bin -r 0.10.3

Caveats:

  • I had an issue with unicode chars that got converted: it uses uglify.js and this needs to be configured to leave them alone
@iAugur
iAugur / ansible-ip-list-play.yml
Last active August 22, 2021 13:09
Ansible: Example of working with lists of host vars
---
- hosts: servers
gather_facts: true
sudo: true
vars:
fail2ban_config_ignoreip:
- "127.0.0.1/8"
- "{{ ansible_ssh_host }}"
@soypat
soypat / sleep.go
Created February 12, 2021 18:02
Cgo usleep vs. pure Go time.Sleep. Run with `go test -bench=.`
package ctest
// #include <time.h>
// void wait(int usec)
// {
// usleep(usec);
// }
import "C"
import "time"