Skip to content

Instantly share code, notes, and snippets.

View GuyCarver's full-sized avatar

Guy Carver GuyCarver

  • Bethesda Game Studios
  • Maryland
View GitHub Profile
@GuyCarver
GuyCarver / pong.fsx
Created September 23, 2016 03:32
F# version of pong.cs example for Continuous app. Only partially implemented due to some bugs in the app.
//
// Pong Example
//
// Implements a basic version of the classic game for two players.
// Swipe up and down on the left to move the left paddle, and
// swipe on the right side for the right paddle.
//
// Tip: If the editor freezes while you type,
// turn off "Auto Run" in the settings.
//
@GuyCarver
GuyCarver / quick_text.fsx
Created September 23, 2016 03:21
F# version of QuickText.cs example for Continuous app
//
// Quick Text Example
//
// Enables you to text quickly by defining standard messages.
//
// 1. Add the ability to delete messages
// 2. Add the most recent message at the top
//
open System
@GuyCarver
GuyCarver / tip.fsx
Last active July 4, 2018 09:45
F# version of tipcalculator.cs example for Continuous app
//
// Tip Calculator Example
//
// Calculates a tip and total given a bill amount
//
open System;
open Xamarin.Forms;
let clr1 = Color.FromRgb (150, 200, 190)
@GuyCarver
GuyCarver / plotting.fsx
Created September 23, 2016 03:17
F# version of plotting.cs example for Continuous app
//
// Plotting Example
//
// Demonstrates the use of OxyPlot to plot functions.
//
open System
open System.Linq
open OxyPlot
@GuyCarver
GuyCarver / map.fsx
Last active September 23, 2016 07:41
F# version of map.cs example for Continuous app
//
// Map Example for Continuous
//
// Displays a point on a map
//
// Experiments:
// 1. Change the coordinate to your home
// 2. Add more pins
// 3. Change the map type to a satellite view
//
@GuyCarver
GuyCarver / templates.py
Last active August 29, 2015 14:02
Template script for pythonista
import ui
from time import sleep
import editor
import types
import console
'''
This script runs ok forever if it's the only script you run.
Other scripts may also be run if you only run this one once.
But if you run this 2 or more times any other script you try to run thereafter will lock up.
@GuyCarver
GuyCarver / Soldier.py
Created December 1, 2012 07:16
create Images directory if doesn't exist.
#example of animated frames for a character walk.
#downloads a soldier sprite sheet, cuts out frames for the walk cycles in 4 directions
# and animates the character walking in the direction controlled by gravity.
from scene import *
from PIL import Image
import urllib, os
start = Point(3, 1) #the sheet has 8 sets of characters in a 4x2 grid.
ssize = Size(96, 128)
@GuyCarver
GuyCarver / confetti.py
Created December 1, 2012 05:54
confetti
# Modified Particles sample to show rotating rectangles.
import canvas
from scene import *
from random import random
from colorsys import hsv_to_rgb
from threading import Thread, Event
p_size = 64
mt = True
@GuyCarver
GuyCarver / rssfeeds.py
Created November 30, 2012 03:02
show scrolling lists of rss feeds.
#https://gist.github.com/GuyCarver/4173534
from scene import *
import feedparser
from time import sleep
import random
import Queue
from threading import Thread, Event
fontsize = 25
@GuyCarver
GuyCarver / paste.py
Created November 25, 2012 10:31
Pythonista editor script to paste clipboard to buffer.
#paste clipboard to buffer.
import clipboard
import editor
cliptext = clipboard.get()
if cliptext != '':
text = editor.get_text()
selection = editor.get_selection()
selected_text = text[selection[0]:selection[1]]
replacement = cliptext + selected_text