Skip to content

Instantly share code, notes, and snippets.

View neufeldtech's full-sized avatar

Jordan Neufeld neufeldtech

View GitHub Profile
@neufeldtech
neufeldtech / ExcelToJsDate.js
Last active September 11, 2015 03:42 — forked from christopherscott/ExcelToJsDate.js
Convert Excel date values to JavaScript date objects
// Convert Excel dates into JS date objects
//
// @param excelDate {Number}
// @return {Date}
function getJsDateFromExcel(excelDate) {
// JavaScript dates can be constructed by passing milliseconds
// since the Unix epoch (January 1, 1970) example: new Date(12312512312);
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Extra Format')
.addItem('Horizontal', 'formatHorizontal')
.addItem('Vertical', 'formatVertical')
.addToUi();
}
function formatHorizontal() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
@neufeldtech
neufeldtech / angular_http_loop.js
Created October 15, 2015 16:22
Looping through http calls in angular controller
for (var i = 1; i < 6; i++) { // 6 is just a given number, it could be 1 or 100....
(function(i){
http({method: 'POST', url: '/path/to/rest/friend', data: {"name":"Auto Friend " + i}})
.then(function (response) {
console.log("friend created");
console.log(response);
}, function () {
console.log('Whoops...');
});
<script>
jQuery( document ).ready(function() {
(function(jQuery){
jQuery.extend({
jGFeed : function(url, fnk, num, key){
// Make sure url to get is defined
if(url == null) return false;
// Build Google Feed API URL
var gurl = "https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;
if(num != null) gurl += "&num="+num;
# http://stackoverflow.com/questions/7244321/how-to-update-a-github-forked-repository
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
@neufeldtech
neufeldtech / sample-test-1.js
Created July 4, 2016 23:55 — forked from jedwood/sample-test-1.js
API Testing Example - Part 1
describe('Authentication', function() {
it('errors if wrong basic auth', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('incorrect', 'credentials')
.expect(401, done)
});
it('errors if bad x-api-key header', function(done) {
http://stackoverflow.com/questions/8965855/coffeescript-when-to-use-fat-arrow-over-arrow-and-vice-versa
Yo yo, this might help understanding the @ symbol and fat and skinny arrows.
Notice that the context of the @ symbol is inside a class.
Notice that the context of the fat vs skinny arrows are when dealing with callbacks.
class Test
constructor: ->
@canvas = document.createElement 'canvas'
window.addEventListener 'resize', ->
[Unit]
Description=IPFS daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/ipfs daemon
[Install]
WantedBy=default.target

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

// ==UserScript==
// @name Prometheus Alert To JIRA (Karma Dashboard)
// @version 1.1
// @match http://karma.example.com:8080/*
// @grant GM_xmlhttpRequest
// @require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
const JIRA_URL = "https://jira.example.com";