Skip to content

Instantly share code, notes, and snippets.

Daniel Sposito dsposito

Block or report user

Report or block dsposito

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dsposito
dsposito / Numbers.php
Last active Dec 23, 2015
A simple class for interacting with numbers.
View Numbers.php
<?php
/**
* Contains methods for interacting with numbers.
*
* @author Daniel Sposito <daniel.g.sposito@gmail.com>
*/
class Number
{
/**
@dsposito
dsposito / Cards.php
Last active Jan 6, 2018
A simple class for interacting with a deck of cards.
View Cards.php
<?php
/**
* Contains methods for interacting with a deck of cards.
*
* @author Daniel Sposito <daniel.g.sposito@gmail.com>
*/
class Deck
{
/**
@dsposito
dsposito / api_tests.sh
Last active Aug 29, 2015
Super simple API endpoints test script for Volcano: https://github.com/volcano/volcano
View api_tests.sh
# Sellers
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "name=Seller X&contact[company_name]=Seller X, Inc&contact[email]=sellerx@gmail.com" dev.volcano.com/api/sellers
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "name=Seller XY" dev.volcano.com/api/sellers/1
# Seller Callbacks
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/callbacks
curl -X POST -s -o /dev/null -w "%{http_code} - POST - %{url_effective}\n" --data "event=product.meta.update&url=http://localhost/api/webhook" dev.volcano.com/api/sellers/1/callbacks
curl -X GET -s -o /dev/null -w "%{http_code} - GET - %{url_effective}\n" dev.volcano.com/api/sellers/1/callbacks/1
curl -X PUT -s -o /dev/null -w "%{http_code} - PUT - %{url_effective}\n" --data "url=http://loalhost/api/webhook/update" dev.volcano.com/api/sellers/1/callbac
View ros-pilot-simple.py
#!/usr/bin/env python
# ROS
import rospy
from mavros_msgs.srv import SetMode
from mavros_msgs.srv import CommandBool
# System
import time
View ros-pilot-advanced.py
#!/usr/bin/env python
# ROS
import rospy
from mavros_msgs.msg import OverrideRCIn
from mavros_msgs.srv import SetMode
from mavros_msgs.srv import CommandBool
from mavros_msgs.srv import CommandTOL
# System
@dsposito
dsposito / ros-takeoff-hover-land.py
Created Mar 29, 2018
ros-takeoff-hover-land.py
View ros-takeoff-hover-land.py
#!/usr/bin/env python
import rospy
from mavros_msgs.srv import SetMode
from mavros_msgs.srv import CommandBool
from mavros_msgs.srv import CommandTOL
import time
rospy.init_node('mavros_takeoff_python')
rate = rospy.Rate(10)
@dsposito
dsposito / unmapped_listings_parser.py
Last active Apr 24, 2019
This script determines how many unmapped listings have 1-2 matches - which we could crowd source confirm the correct product to map.
View unmapped_listings_parser.py
import csv
unmapped_listings = 0
unmapped_listings_few_matches = 0
with open('lv-listings.csv') as csvfile:
data = csv.reader(csvfile, delimiter=',')
for row in data:
# Listing is missing a direct match loki_product_id.
if not row[11]:
You can’t perform that action at this time.