Skip to content

Instantly share code, notes, and snippets.

@hiorws
hiorws / migrateserver.sh
Created October 22, 2018 07:53 — forked from larvel/migrateserver.sh
Script to copy production server to test server
#!/bin/bash
USER=user
MYSQLPASSWORD=password
MYSQL="/usr/bin/mysql"
MYSQLDUMP="mysqldump --max_allowed_packet=800M"
TESTSERVER=mynewserver.mydomain.com
FOLDER=/usr/local/atlassian/
EXCLUDE="--exclude *.pid --exclude backup/*.zip --exclude atlassian-confluence.log* --exclude catalina.*.log --exclude localhost.*.log --exclude updateTestServer.sh* --exclude daily-backup-* --exclude backup-*.zip --exclude atlassian-jira.log.* --exclude catalina.out --exclude *confluencedata/index* --exclude *confluencedata/backups/* --exclude *prosjektwiki/confluencedata/backups/* --exclude *old/"
@hiorws
hiorws / squareZoom.pde
Created November 20, 2018 14:10 — forked from beesandbombs/squareZoom.pde
square zoom
// zooming squares. by dave
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@hiorws
hiorws / src_MainApp.java
Created November 27, 2018 09:46 — forked from KrabCode/src_MainApp.java
Tessellated spheres source in IntelliJ IDEA - to run this in the vanilla Processing IDE just remove everything that mentions MainApp including the "class MainApp extends PApplet" part and you're golden - also you'll need the PostFX and PeasyCam libraries found in Tools -> Add tool.
import ch.bildspur.postfx.builder.PostFX;
import peasy.PeasyCam;
import processing.core.PApplet;
import processing.core.PShape;
import processing.core.PVector;
import processing.opengl.PShader;
import java.util.ArrayList;
public class MainApp extends PApplet {
@hiorws
hiorws / gif_maker.sh
Created March 20, 2019 12:28 — forked from yanofsky/gif_maker.sh
How to Make a gif from a folder of images
# requirement! install imagemagick
# brew install imagemagick
# or build from source here http://www.imagemagick.org/script/binary-releases.php
#navigate to folder of the images
cd folderofmyimages/
# take every jpg in the folder and smash into a gif with a frame rate of 0.5 sec
convert -delay 50 *.jpg gif_of_my_images.gif
@hiorws
hiorws / OSC_C_01.rb
Created April 8, 2019 10:31 — forked from AlexandreRangel/OSC_C_01.rb
Controling Sonic Pi from Processing OSC
# reading OSC from Processing, Alexandre Enkerli
# full screen, fulltime mouse, Alexandre Rangel
# 24-Nov-2016
# Sonic Pi 2.11
use_bpm 120
set_sched_ahead_time! 0 # Setting that one to a negative value makes Sonic Pi complain, it sounds like.
live_loop :osc do # The loop is inside the fx as this is where the action will be.
osc=sync "/osc" # The OSC message which Processing sends, based on mouse coordinates.

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@hiorws
hiorws / genetic_algo_find_circle.pyde
Created April 11, 2019 10:07 — forked from bened-h/genetic_algo_find_circle.pyde
Simple "genetic" algorithm for Processing (Python mode) showing a random point polpulation evolving to become a circle
"""
This demonstration evolves a random point
population (parent) to order its points into a
circular arrangement (target).
The fitness is computed by measuring each point's
distance to its destination.
Read an introduction to genetic algorithms with python here:
https://www.codeproject.com/articles/1104747/introduction-to-genetic-algorithms-with-python-hel
"""
urls:
http://mubert.com/
http://demo.mubert.com/
http://play.mubert.com/
http://play.mubert.com/pro/
http://play.mubert.com/en/
IDK (Chillstep?)
http://mubert.com:49994/
@hiorws
hiorws / PWindow.pde
Created June 18, 2019 12:04 — forked from atduskgreg/PWindow.pde
Example of creating a Processing sketch with multiple windows (works in Processing 3.0)
class PWindow extends PApplet {
PWindow() {
super();
PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
}
void settings() {
size(500, 200);
}
@hiorws
hiorws / highres.pde
Created August 3, 2019 10:54 — forked from mvanga/highres.pde
A skeleton Processing sketch that allows for exporting high-resolution versions of whatever is on screen.
import processing.pdf.*;
/*
* A complete tutorial can be found over at:
* http://sighack.com/post/exporting-high-resolution-images-in-processing
*/
int seed;
int CONFIG_SCALE_FACTOR = 5;