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
var mongoose = require('mongoose'); | |
var wait = require('wait.for'); | |
mongoose.connect('localhost', 'non_async_tests'); | |
var itemSchema = new mongoose.Schema({ | |
name: String | |
}); | |
var Item = mongoose.model("Item", itemSchema); |
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
pv_by_industry = GROUP profile_view by viewee_industry_id | |
pv_avg_by_industry = FOREACH pv_by_industry | |
GENERATE group as viewee_industry_id, AVG(profie_view) AS average_pv; |
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
import base64 | |
from myapplication import app | |
class MyTestCase(unittest.TestCase): | |
def setUp(self): | |
self.app = app.test_client() | |
def tearDown(self): | |
pass |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import xlrd | |
import xlwt | |
from optparse import OptionParser | |
import datetime | |
""" | |
Merges excel files with multiple sheets with identical header lines into |
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
#!/bin/bash -e | |
# Script for installing Robomongo on Ubuntu. | |
# Copyright 2013 Binary Birch Tree | |
# http://www.binarybirchtree.com | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
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
""" | |
From http://www.authorize.net/support/merchant/Transaction_Response/Response_Reason_Codes_and_Response_Reason_Text.htm | |
""" | |
REASONS = [ | |
# resp code, reason code, reason text, notes | |
[1, 1, "This transaction has been approved."], | |
[2, 2, "This transaction has been declined."], | |
[2, 3, "This transaction has been declined."], | |
[2, 4, "This transaction has been declined.", "The code returned from the processor indicating that the card used needs to be picked up."], |
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
{% include numberWithCommas.html number=1 %} | |
{% include numberWithCommas.html number=12 %} | |
{% include numberWithCommas.html number=123 %} | |
{% include numberWithCommas.html number=1234 %} | |
{% include numberWithCommas.html number=12345 %} | |
{% include numberWithCommas.html number=123456 %} | |
{% include numberWithCommas.html number=1234567 %} | |
{% include numberWithCommas.html number=12345678 %} | |
{% include numberWithCommas.html number=123456789 %} | |
{% include numberWithCommas.html number=1234567890 %} |
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
########################################## | |
# To run: | |
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
########################################## | |
# Check that HTTPS transport is available to APT | |
if [ ! -e /usr/lib/apt/methods/https ]; then | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
fi |
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
import cv2.cv as cv | |
import tesseract | |
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
api = tesseract.TessBaseAPI() | |
api.Init(".","eng",tesseract.OEM_DEFAULT) | |
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
tesseract.SetCvImage(gray,api) | |
print api.GetUTF8Text() |
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
' http://support.microsoft.com/kb/291296/en-us | |
' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file | |
' - change integer to long indexing | |
' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba | |
' - output utf8 content | |
Sub QuoteCommaExport() | |
' Dimension all variables. | |
Dim DestFile As String | |
Dim FileNum As Integer |
OlderNewer