Skip to content

Instantly share code, notes, and snippets.

View sammarcus's full-sized avatar
💭
hi

Sam Marcus sammarcus

💭
hi
View GitHub Profile
@BondAnthony
BondAnthony / wall-connector-influxdb.yaml
Last active October 7, 2023 07:45
Tesla Wall Connector
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: wizardly-northcutt-83c00b
spec:
associations:
- kind: Label
name: frosty-hamilton-83c001
name: kwh_price
description: Price per kilowatt-hour
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
abtauthprd.samsungcloudsolution.com
acr0.samsungcloudsolution.com
ad.samsungadhub.com
ads.samsungads.com
amauthprd.samsungcloudsolution.com
api-hub.samsungyosemite.com
# Player 1 plays 0s
# Player 2 plays 1s
if item.even?
box[move] = 'X'
elsif item.odd?
box[move] = '0'
end
# Did player 1 win?
if item.odd? and item > 3 and player_winner?(box, '0')
anonymous
anonymous / gist:2c029e7e81288208ecc8
Created September 11, 2014 00:47
puts "Welcome to Tic Tac Toe, let's play!"
puts "Player 1, what is your name?"
player1 = gets.chomp
puts "Welcome #{player1}. Player 2, what is your name?"
player2 = gets.chomp
puts "Thanks #{player1} and #{player2}. #{player1}, make your first move by
typing the number that corresponds to the grid below"
@svenvarkel
svenvarkel / fix_permissions.sh
Created December 20, 2013 22:40
Fix file permissions in your Magento project folder. It has some constraints: - use group name "dev" for your developers and your "php/web server user" (www-data) - it's untested in other environments than Debian/Ubuntu
#!/bin/bash
#
# This script fixes permissions on Magento subtree
#
# Usage:
# cd to virtual host folder
# run script by issuing utils/fix_permissions.sh . command
#
# Author Sven Varkel <sven@mageflow.com>
# Copyright 2013 MageFlow Ltd
@varinen
varinen / mysql4-install-0.1.0.php
Created December 17, 2012 22:04
One possible approach to adding attribute sets and groups in Magento
<?php
/**
* Installer script
*
* @category Solvingmagento
* @package Solvingmagento_Samples
* @author Oleg Ishenko <oleg.ishenko@solvingmagento.com>
* @copyright Copyright (c) 2012 - 2013 Oleg Ishenko
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @version GIT: <0.1.0>
@ttjoseph
ttjoseph / itascrape.py
Created July 3, 2010 15:59
Finds the cheapest place for a bunch of people to fly to by screen-scraping ITA Software's Matrix fare search site
#!/usr/bin/python
import urllib, urllib2
import re, cookielib
import os, time, sys
from BeautifulSoup import BeautifulSoup
COOKIE_FILE = 'cookies.dat'
BASE_URL = "http://matrix1.itasoftware.com"
INIT_URL = BASE_URL + "/cvg/dispatch"