Skip to content

Instantly share code, notes, and snippets.

@Naheel-Azawy
Naheel-Azawy / mandelbrot.c
Last active July 24, 2017 18:55 — forked from andrejbauer/mandelbrot.c
A simple program for computing the Mandelbrot set.
/*
This program is an adaptation of the Mandelbrot program
from the Programming Rosetta Stone, see
http://rosettacode.org/wiki/Mandelbrot_set
Compile the program with:
gcc -o mandelbrot -O4 mandelbrot.c
Usage:
./mandelbrot <xmin> <xmax> <ymin> <ymax> <maxiter> <xres> <out.ppm>
Example:
@Naheel-Azawy
Naheel-Azawy / rename-gnome-builder-project-app-id.sh
Last active February 16, 2018 00:48
Renames the app-id of a project built with GNOME Builder. Usage `rename-gnome-builder-project-app-id.sh "org.something.blabla"`
#!/bin/sh
OLD=$(grep -rh '"app-id":' *.json | sed 's/[",]//g' | awk '{print $2}')
NEW=$1
OLD2="${OLD//./\\.}"
OLD3="${OLD//.//}"
OLD4="${OLD//./\\/}"
NEW4="${NEW//./\\/}"
for s in $(find -name "*$OLD*"); do mv $s "${s/$OLD/$NEW}"; done
for s in $(grep -rIl $OLD2); do sed -i "s/$OLD2/$NEW/g" $s; done
for s in $(grep -rIl $OLD3); do sed -i "s/$OLD4/$NEW4/g" $s; done