Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View renanyoy's full-sized avatar

renan jegouzo renanyoy

View GitHub Profile
@renanyoy
renanyoy / gist:d8f1841ae40ee5cc65cdbb52aee5252b
Created January 6, 2024 02:15 — forked from analogcode/gist:fa097afb59ee57ccd29e59dfb2526977
Handling AudioBus MIDI Input & State Saving
// **********************************************************
// MARK: - AudioBus MIDI Input
// **********************************************************
extension ParentViewController {
func setupAudioBusInput() {
midiInput = ABMIDIReceiverPort(name: "FM Player MIDI In", title: "FM Player MIDI In") { (port, midiPacketListPointer) in
let events = AKMIDIEvent.midiEventsFrom(packetListPointer: midiPacketListPointer)
@renanyoy
renanyoy / gist:ebe16d721597606d6c511b60a7411c01
Last active December 15, 2017 04:45
xcode, debug obj_msgSend crash
p (char *) object_getClassName(*(long*)($x0))
p (char *) $x1
p (char *) $x2
@renanyoy
renanyoy / nodejs-tcp-example.js
Created December 30, 2015 08:56 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
#!/bin/sh -x
cd /tmp
if [ ! -d "geocouch" ]; then
git clone https://github.com/couchbase/geocouch.git
fi
cd geocouch
git checkout couchdb1.2.x
// relay.js
var util = require('util');
var net = require('net');
var dns = require('dns');
var nurl = require('url');
var host = '127.0.0.1';
var port = 6969;
var source = '';
@renanyoy
renanyoy / crayola.json
Created February 25, 2016 08:07 — forked from jjdelc/crayola.json
Crayola colors in JSON format
[
{
"hex": "#EFDECD",
"name": "Almond",
"rgb": "(239, 222, 205)"
},
{
"hex": "#CD9575",
"name": "Antique Brass",
"rgb": "(205, 149, 117)"
@renanyoy
renanyoy / Synology-Diskstation-Git.md
Created October 11, 2015 08:34 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@renanyoy
renanyoy / pixelate.js
Created September 3, 2015 08:45
javascript, pixel effect + black and white
// usage: <image src="cool-dog.png" onload="pixelate(this,16)"/>
(function() {
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
var anims = [];
function pulse() {
var a = anims.slice();
for (var i = 0; i < a.length; i++)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading;
namespace KillX2Go
{
@renanyoy
renanyoy / png2jpeg.sh
Last active August 29, 2015 14:11
convert all png to jpeg
function png2jpeg() {
echo 'Warning this command wil convert all png in jpeg recursively and delete png files'
echo "Do you wish to Continue?"
select yn in "Yes" "No"; do
case $yn in
Yes )
for f in `find . -name "*.png"`
do
alpha=$(identify -format %A $f)
if [ "$alpha" == 'False' ]