Skip to content

Instantly share code, notes, and snippets.

View ttennebkram's full-sized avatar

Mark Bennett ttennebkram

  • Lucidworks, previously New Idea Engineering
  • San Francisco, CA
View GitHub Profile
@yee379
yee379 / phone_location.py
Last active February 15, 2023 15:32
Determine a phone number's country and region.
import yaml
def locate_phone_number( s, country_code='1', region_code='650', region_digits=7, internal_digits=4, country_digits=10, locations={}, **kwargs ):
s = str(s)
# internal number
if len(s) == internal_digits:
return 'internal', None, s
@JnBrymn
JnBrymn / SearchAsYouType.html
Created June 8, 2013 04:00
This is a demo search UI for demonstrating Search As You Type with Solr.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>search as you type</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
@nyov
nyov / magento-cli.py
Last active August 15, 2021 12:57
A Magento REST API example with rauth as OAuth provider. For Magento 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from rauth.service import OAuth1Service
# Create consumer key & secret in your Magento Admin interface
# For an API Guideline see:
# http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html
#
# Short Magento setup explanation: