This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python script to place components in a circle | |
# based on http://kevincuzner.com/2017/04/28/arranging-components-in-a-circle-with-kicad/ | |
# but ported to Python 3 and KiCad 5.x | |
# You can just open "Tools->Scripting Console" and paste the whole thing. | |
# Needs to be in 3 parts: first the import line, then the function definition (and hit enter twice), | |
# and finally the place_circle call. | |
# Since refs can't have spaces in the name, I also simplified the list creation with the split function. | |
import math, pcbnew |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
// creates a toolbar with two buttons with a C# script, without prefabs | |
// extension method to set all values of a RectOffset to the same value | |
public static class Extensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# prints all happy numbers <= 100 | |
# https://en.wikipedia.org/wiki/Happy_number | |
# returns true, if the number is happy | |
def happy?(n) | |
n = n.digits.sum { |x| x * x } while n > 6 | |
n == 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Tilemaps; | |
// Load a tileset PNG from the streamingAssets folder, and create a | |
// Unity Tilemap and all necessary objects with a C# script. | |
// Attach this script to an empty GameObject. | |
// Copyright 2020 by Frank Buss. Can be used for free in any project. | |
public class TilemapTest : MonoBehaviour |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rd /s /q Library | |
rd /s /q Temp | |
rd /s /q obj | |
rd /s /q logs | |
rd /s /q .vs | |
del /s /q /f *.csproj | |
del /s /q /f *.pidb | |
del /s /q /f *.unityproj | |
del /s /q /f *.DS_Store | |
del /s /q /f *.sln |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Converts a PNG image to an echo command with ANSI codes | |
# Copyright (c) 2020, Frank Buss | |
# All rights reserved. | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
abstract class Tile | |
{ | |
} | |
class SeaTile : Tile | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Converts the 56 digits 2D Australia Post barcode to the 22 digits tracking number. | |
# Reads from stdin until newline, and copies the tracking number to the clipboard. | |
# Other characters then digits are removed. | |
# | |
# Needs Python3 and the clipboard library. Install from the command line like this: | |
# pip3 install clipboard | |
# Then save this file as barcode.py and start the script like this: | |
# python barcode.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- creates an olympic rings image and saves it as test.tga | |
-- output: http://www.frank-buss.de/haskell/OlympicRings.png | |
import Data.Binary | |
-- image size | |
data Size = | |
Size | |
{ width :: Integer | |
, height :: Integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
private static System.Type[] types = { | |
typeof(Integer), | |
typeof(Long), | |
typeof(String)}; |