Skip to content

Instantly share code, notes, and snippets.

View pushmatrix's full-sized avatar

Daniel Beauchamp pushmatrix

View GitHub Profile
@pushmatrix
pushmatrix / gist:6685130
Created September 24, 2013 13:56
Linking to an External Style Sheet
<h3>Overview</h3>
<p>Up to this point in the course you have learned how to add style to your
web pages by inserting a style section using the <strong>&lt;style&gt;</strong> element. But what
if you want to change the look of the entire website? If your entire website
was built with style definitions inside each page, that would mean going back
into each page individually and changing the style. Fortunately, CSS provides
a means of using an external style sheet to control the presentation of a large
set of web pages. With an external style sheet, if you want to change the font
style (or any other style definition) across an entire site, you only have
to change it in one place. </p>
@pushmatrix
pushmatrix / gist:6570585
Last active May 23, 2023 17:17
How to get started building a ship tracking app.
- Find an API that supplies the data.
- I found the one that MarineTraffic.com uses (http://www.marinetraffic.com)
- Open your computer's terminal, and paste this:
curl 'http://www.marinetraffic.com/ais/getjson.aspx?sw_x=0&sw_y=70&ne_x=30&ne_y=80&zoom=6&fleet=&station=0&id=null' -H 'Referer: http://www.marinetraffic.com/ais/'
- This shows you all the data. You will now need to automate calling this API
- Get the data from the API using something like jQuery:
- Documentation: http://api.jquery.com/jQuery.getJSON/
- Tutorial :http://www.youtube.com/watch?v=3hN4PrJ7R6A
require 'http'
class OpenAI
URI = "https://api.openai.com/v1"
def initialize(api_key:)
@api_key = api_key
end
def completion(prompt:, max_tokens: 400, temperature: 1.0, stop: "<|endoftext|>")
response = HTTP.headers(headers).post(
@pushmatrix
pushmatrix / instructions.md
Created February 21, 2020 01:35
Embedding Unity Packages

Embedding packages

Let's say you want to edit a package that you download with the package manager. You can actually make it so you have a local copy of the package that overrides what's in your package cache.

  1. Put this in your Unity project: https://gist.github.com/liortal53/111ee2a659b0d59c80faab0f5d457531
  2. Right click on the package you want, and press Embed Package
  3. You now have a copy of the package in your Packages dir
  4. If you delete that package folder, Unity will automatically switch back to using the package manager version. All references to scripts will stay intact.
@pushmatrix
pushmatrix / sample.erb
Created October 30, 2012 01:37
Dashing Dashboard sample
<% content_for(:title) { "My super sweet dashboard" } %>
<div class="gridster">
<ul>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="karma" data-view="Number" data-title="Karma" style="background-color:#96bf48;"></div>
</li>
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="valuation" data-view="Number" data-title="Current Valuation" data-prefix="$"></div>
</li>
float scale = Mathf.Min((targetWidth / screenWidth), 1);
platformYPosition = Mathf.Sin(realtime.room.time);
@pushmatrix
pushmatrix / wordlist
Last active January 1, 2022 09:38
Complete Swedish Duolingo word list (as of March 15, 2015)
man
kvinna
är
pojke
flicka
jag
en
han
hon
ett
@pushmatrix
pushmatrix / helmet.gltf
Last active July 17, 2020 17:07
Melded helmet
{
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"count": 70074,
"componentType": 5126,
"type": "VEC3",
"min": [
-1.151152491569519,
@pushmatrix
pushmatrix / chair.gltf
Created July 17, 2020 15:35
Melded chair
{
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"count": 10043,
"componentType": 5126,
"type": "VEC3",
"min": [
-16.300094604492188,