Skip to content

Instantly share code, notes, and snippets.

View enzyme69's full-sized avatar
🎯
Blender and AR~!

Jimmy Gunawan enzyme69

🎯
Blender and AR~!
View GitHub Profile
@revolunet
revolunet / extractGifs.py
Created March 1, 2011 09:48
extract frames from animated gif using python+PIL
import os
from PIL import Image
def extractFrames(inGif, outFolder):
frame = Image.open(inGif)
nframes = 0
while frame:
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
nframes += 1
@ny0m
ny0m / slice.py
Created June 2, 2013 15:49
A python class to split a word into separate units, split into syllables, called morphemes. Part of a portmanteau generator I built.
class Slice(object):
def __init__(self, root, leng):
self.root = root # The original word
self.leng = leng # How many morphemes should be used as the prefix for the new portmanteau
self.morphemes = []
self.output = '' #
self.slice()
def slice(self):
import re
@asarode
asarode / generateRandomColor.swift
Last active September 18, 2024 20:50
Generating random UIColor in Swift
func generateRandomColor() -> UIColor {
let hue : CGFloat = CGFloat(arc4random() % 256) / 256 // use 256 to get full range from 0.0 to 1.0
let saturation : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from white
let brightness : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from black
return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: 1)
}
@samisalkosuo
samisalkosuo / maze.py
Last active November 17, 2017 03:52
Some mazes classes translated from Ruby from book: Mazes for Programmers (https://pragprog.com/book/jbmaze/mazes-for-programmers). Used in MazinGame: https://github.com/samisalkosuo/mazingame
#!/usr/bin/env python
#Some mazes classes translated from Ruby
#from book "Mazes for Programmers" by Jamis Buck.
#https://pragprog.com/book/jbmaze/mazes-for-programmers
#
#Includes modifications.
#
#Execute this and you see mazes.
@jwinder
jwinder / sonic-pi-tutorial.md
Last active September 22, 2023 20:12
Sonic Pi in-app tutorials concatenated - last synced 27-08-2023 - https://sonic-pi.net/tutorial.html - https://github.com/samaaron/sonic-pi - All credit & thanks to Sam Aaron!

1 Welcome to Sonic Pi

Welcome friend :-)

Welcome to Sonic Pi. Hopefully you're as excited to get started making your own sounds as I am to show you. It's going to be a really fun ride where you'll learn all about music, synthesis, programming, composition, performance and more.

@schickling
schickling / UIImageFixedOrientationExtension.swift
Last active December 31, 2024 22:21
Extension to fix orientation of an UIImage (Sets orientation to portrait)
extension UIImage {
func fixedOrientation() -> UIImage {
if imageOrientation == UIImageOrientation.Up {
return self
}
var transform: CGAffineTransform = CGAffineTransformIdentity
@mchirico
mchirico / RW.swift
Created October 15, 2015 16:25
RW to file in swift
//
// RW.swift
// Web
//
// Created by Mike Chirico on 10/15/15.
// Copyright © 2015 Mike Chirico. All rights reserved.
//
import UIKit
@codelynx
codelynx / simd+ext.swift
Last active November 17, 2021 18:56
swift: float4x4 extension to scale, rotate, translate 4x4 matrix
//
// simd+ext.swift
//
// Created by Kaz Yoshikawa on 11/6/15.
//
//
import Foundation
import simd
import GLKit
@tado
tado / polka_dot.pde
Last active March 8, 2016 13:18
Circle Fitting image
ArrayList<Bubble> bubbles; //Bubbleクラスを格納するArrayList
PImage image; //色をピックアップするイメージ
int maxSize = 40; //円の最大サイズ(直径)
void setup() {
//画面初期設定
size(1200, 900);
frameRate(60);
noStroke();
//ArrayListの初期化
@zeffii
zeffii / fft.py
Created September 18, 2016 07:23
fft node
# ##### 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