Skip to content

Instantly share code, notes, and snippets.

View wouterds's full-sized avatar
:octocat:
Hello world!

Wouter De Schuyter wouterds

:octocat:
Hello world!
View GitHub Profile
@eznj
eznj / star_wars.ino
Last active September 26, 2023 18:24
Arduino Star Wars Song
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
const int b = 466;
const int cH = 523;
@andrewgleave
andrewgleave / iOSMapKitFitAnnotations.m
Last active November 4, 2022 15:21
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
@lewayotte
lewayotte / cloudflare-dns.php
Last active March 17, 2022 09:32
Cloud Flare Automatic DNS Record Updater (PHP Script)
#!/usr/bin/php
<?php
/**
* Script used to update DNS records in Cloud Flare when server IP address changes.
* My use case is to run this script on startup, when I spin up a new Digital Ocean VPS but
* this could easily be used to update for dynamic DNS with a cronjob.
*
* Digital Ocean referral code: https://www.digitalocean.com/?refcode=3655e259ce29
*
* Requires PHP cURL
@MattWilcox
MattWilcox / build_nginx.sh
Last active March 6, 2022 18:01
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
@jpantuso
jpantuso / osx_lion_rail_setup.md
Created July 27, 2011 19:51
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@svnlto
svnlto / install.md
Created December 12, 2011 22:59
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, nvm

Setup new Mac with OSX Lion from scratch

These commands are good as of 2011-07-27.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

@svpino
svpino / twitter-unfollow.ipynb
Created August 11, 2020 18:58
twitter-unfollow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MaximKeegan
MaximKeegan / FadeScrollView.h
Created April 24, 2012 11:15
Fade edges UIScrollView
//
// FadeScrollView.h
// scroll_test
//
// Created by Maxim Keegan on 24.04.12.
// Copyright (c) 2012 East Media Ltd. All rights reserved.
//
#import <UIKit/UIKit.h>