Skip to content

Instantly share code, notes, and snippets.

View neufeldtech's full-sized avatar

Jordan Neufeld neufeldtech

View GitHub Profile

Interview Brief: URL Shortener Implementation

Objective:

The goal of this pair programming interview is to build a functional URL shortener within 75 minutes. The focus should be on implementing core features that meet the main functional requirements. Scalability and database design concerns should be secondary and only briefly discussed if time permits.

Functional Requirements:

  1. Short Link Generation:
    • Given a URL, the service should generate a shorter and unique alias (short link).
    • The short link should be easy to copy and paste into applications.
@neufeldtech
neufeldtech / yolo.go
Last active November 27, 2020 22:09
yolo.go
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"log"
"net"
"net/http"
// ==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";

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

[Unit]
Description=IPFS daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/ipfs daemon
[Install]
WantedBy=default.target
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', ->
@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/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
<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;
@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...');
});