This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extractData(messages) { | |
let data = {}; | |
messages.forEach(message => { | |
if (message.symbols) { | |
let symbols = message.symbols; | |
symbols.forEach(symbol => { | |
if (data[symbol.symbol]) { | |
data[symbol.symbol].count += 1; | |
} else { | |
data[symbol.symbol] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the alias below to ~/.bash_profile on a Mac | |
# Save the file and run: source ~/.bash_profile | |
alias code='open $@ -a "Visual Studio Code"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void RequestStartup(ILifetimeScope requestContainer, IPipelines pipelines, NancyContext context) | |
{ | |
pipelines.OnError.AddItemToEndOfPipeline((z, a) => | |
{ | |
log.Error("Unhandled error on request: " + context.Request.Url + " : " + a.Message, a); | |
return ErrorResponse.FromException(a); | |
}); | |
base.RequestStartup(requestContainer, pipelines, context); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two things are important to note: | |
# | |
# 1) The code is fugly, because it was a JavaScript/iPad experiment. | |
# I know that it is ugly, so pretty please don't comment on that part. | |
# 2) I tried to use as many CoffeeScript features as possible, | |
# including but not limited to list comprehensions, | |
# heredocs, destructuring assignment and also the "do" operator | |
# | |
# I welcome comments about stuff that is not CoffeeScripty enough, or what I should | |
# write differently. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://download.mono-project.com/repo/xamarin.gpg | |
sudo apt-key add xamarin.gpg | |
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee --append /etc/apt/sources.list.d/mono-xamarin.list | |
sudo apt-get update | |
sudo apt-get install mono-complete | |
sudo certmgr -ssl -m https://go.microsoft.com | |
sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net | |
sudo certmgr -ssl -m https://nuget.org | |
mozroots --import --sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was updated in order to support OpenCV v.3. (note lines 13, 14, 33, 43) | |
# import the necessary packages | |
import numpy as np | |
import cv2 | |
def detect(image): | |
# convert the image to grayscale | |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* dragging logic for nomadlist.com/dating */ | |
/* by @levelsio */ | |
/* MIT license */ | |
/* <dragging logic> */ | |
$('body').on('mousedown touchstart','.card',function(e) { | |
if(!currentCardUserId) return; | |
if($('card.match_card').is(':visible')) return; | |
if(typeof e.originalEvent.touches !=='undefined') { | |
/* touch device */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
// Emitted when the DOM is parsed and ready (without waiting for resources) | |
page.once('domcontentloaded', () => console.info('✅ DOM is ready')); | |
// Emitted when the page is fully loaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// optimized to find a vertical barcode in an image | |
// inspired by http://www.pyimagesearch.com/2014/11/24/detecting-barcodes-images-python-opencv/ | |
using System; | |
using System.Drawing; | |
using System.Windows.Forms; | |
using OpenCvSharp; | |
using OpenCvSharp.Extensions; | |
namespace LocateBarcode |
OlderNewer