Skip to content

Instantly share code, notes, and snippets.

🎃
👉😎👉 zoop

Jesse Lieberg GammaGames

🎃
👉😎👉 zoop
Block or report user

Report or block GammaGames

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
@GammaGames
GammaGames / test.sh
Last active Jun 5, 2020
Pipe commands to docker container from host
View test.sh
#!/bin/sh
echo "foo"
# Pipe commands between patterns into container
sed -n "/^### SCRIPT START ###/,/^### SCRIPT END ###/p" "$0" | docker exec -i -e MESSAGE="bar" <id> /bin/bash -
echo "baz"
# Exit original script
exit
View gh-pages.md

Basic

  1. Create a new repo (gp-pages-simple)
  2. Go to settings
  3. Choose a theme
  4. Edit your index.md file
  5. Commit to master branch
  6. Go to username.github.io/gp-pages-simple

http://jekyllthemes.org/

@GammaGames
GammaGames / is_duck.py
Created Jan 22, 2020
Check if object has method and return function result
View is_duck.py
class Duck():
def quack(self):
print("quack!")
class Goose(Duck):
def quack(self):
print("honk!")
@GammaGames
GammaGames / batch_obj_export.py
Last active Apr 10, 2020
Batch obj file exporter for blender 2.8, now with mesh centering
View batch_obj_export.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@GammaGames
GammaGames / plaintext.json
Last active Oct 25, 2019
enjamb vscode snippets
View plaintext.json
{
"putc": {
"prefix": "putc",
"body": [
"."
]
},
"putn": {
"prefix": "putn",
"body": [
@GammaGames
GammaGames / Area.gd
Last active Aug 24, 2019
Godot Viewport Input from Raycast (Useful for VR)
View Area.gd
extends Area
onready var viewport = $"../Viewport"
onready var collion = $CollisionShape
var last_collided = Vector3.ZERO
var mouse_mask = 0
var mesh_size_x = 0.5
var mesh_size_y = 0.5
var uv_offset_x = -0.1
var uv_offset_y = -0.1
@GammaGames
GammaGames / release.js
Last active Aug 12, 2019
Get the latest release and assets for a github repo from a static javascript page
View release.js
let username = "";
let repo = "";
window.onload = () => {
fetch(`https://api.github.com/repos/${username}/${repo}/releases/latest`).then(response => {
response.json().then(json => {
console.log(json);
});
});
}
View tilemap2.yaml
- height*curse:
- 1@25:-,1:=curse
- height*moisture:
- 1@2:rock,1:snow
- 1@2:grass,3:plants
- 2@moisture*fertility:
- 1@1:dirt,2:grass,3:plants
- 2@2:dirt,3:grass,1:plants
- 1@3:sand,2:dirt
- 1@2:sand,1:dirt,1:grass,1:plants,2:=water
View tilemap.yaml
- height*moisture:
- 1@2:rock,1:snow
- 2@1:sand,2:dirt,2:grass
- 3@1:=water
- tile*population:
- sand@9:-,1:buildings
- grass,dirt@3:-,1:buildings
@GammaGames
GammaGames / parse_md.py
Created Apr 26, 2019
Parse markdown files into html files
View parse_md.py
from markdown2 import Markdown
import os
markdown = Markdown()
for root, dirs, files in os.walk("/var/www/html", topdown=False):
for name in files:
if name.endswith(".md"):
filename = os.path.join(root, name)
with open(filename, 'r') as md_file:
html_filename = os.path.join(root, "{}.html".format(os.path.splitext(filename)[0]))
You can’t perform that action at this time.