Skip to content

Instantly share code, notes, and snippets.

View dorald's full-sized avatar
🏠
Working from home

Do dorald

🏠
Working from home
View GitHub Profile
@yifanlu
yifanlu / Ghidra-OSX-Launcher-Script.scpt
Last active April 4, 2024 21:00
Ghidra.app launcher for OSX
@ofZach
ofZach / gist:d67d2ab2a0aa183b7d34f72263d5c5bd
Created November 27, 2017 07:44
looping 1d noise (tiling)
ofPolyline temp;
float ff = ofGetElapsedTimef();
for (int i = 0; i < 100; i++){
float angle = ofMap(i, 0, 100, 0, TWO_PI);
ofPoint pt= ofPoint(400,400);
float radius = 200 + ofSignedNoise(ff*0.1, cos(angle)*0.3, sin(angle)*0.3) * 100;
pt += radius * ofPoint(cos(angle), sin(angle));
temp.addVertex(pt);
}
temp.setClosed(true);
#include "ofApp.h"
// Note:
// You need ofxGui
// You can download the texture here: https://www.dropbox.com/s/15lw3lh87yp11za/tex-bigger.jpg?dl=1
ofPolyline resampled;
ofPolyline points;
ofParameter<float> resampleLength;
ofParameter<bool> bDrawWireframe;
@robotconscience
robotconscience / ofxiOSImageSaver.h
Created September 10, 2014 16:05
openFrameworks iOS image saving
//
// ofxiOSImageSaver.h
// Colorizer
//
// Created by Brett Renfer on 9/9/14.
//
#pragma once
#include "ofMain.h"
@riebschlager
riebschlager / ofApp.cpp
Last active September 26, 2015 09:12
collage
#include "ofApp.h"
void ofApp::setup(){
source.loadImage("source.jpg");
source.resize(CANVAS_WIDTH, CANVAS_HEIGHT);
canvas.allocate(CANVAS_WIDTH, CANVAS_HEIGHT, GL_RGBA);
canvas.begin();
ofBackground(0, 0, 0);
@mikeabdullah
mikeabdullah / gist:4740463
Last active January 6, 2024 07:31
Atomic file copying
- (BOOL)atomicCopyItemAtURL:(NSURL *)sourceURL
toURL:(NSURL *)destinationURL
error:(NSError **)outError
{
NSFileManager *manager = [NSFileManager defaultManager];
// First copy into a temporary location where failure doesn't matter
NSURL *tempDir = [manager URLForDirectory:NSItemReplacementDirectory
inDomain:NSUserDomainMask
appropriateForURL:destinationURL
@roxlu
roxlu / RainbowArc.cpp
Created September 15, 2012 12:33
Generating vertices for textured arcs
#include "RainbowArc.h"
RainbowArc::RainbowArc(VerticesPT& vertices)
:radius(100)
,width(5)
,fg_start_dx(0)
,fg_num_vertices(0)
,bg_start_dx(0)
,bg_num_vertices(0)
,vertices(vertices)