Skip to content

Instantly share code, notes, and snippets.

View magamig's full-sized avatar
🦤

Miguel Magalhães magamig

🦤
View GitHub Profile
@magamig
magamig / porto.geojson
Last active April 29, 2020 00:23
GeoJSON - "Freguesias" / Parishes in Porto (Portugal)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magamig
magamig / new7wonders.json
Created March 20, 2020 11:26
New 7 Wonders of the World (GeoJSON)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){
srand(time(NULL));
int c, i, rolls = 0, sides = 0, sum = 0;
FILE *file;
file = fopen("input.txt", "r");
if (file) {
@magamig
magamig / shorten
Created November 27, 2015 16:00
Script to shorten URLs (through bit.ly) (from: http://www.aproposmac.com/2011/06/shorten-url-on-bitly-using-curl.html and j.erik comment)
#!/bin/bash
#
# Change 'YOURLOGIN' and 'YOURAPIKEY' before using!
#
# Instructions:
# 1. Copy the url you wish to shorten to the clipboard.
# 2. Run the script, the shorten url will be in your
# clipboard now and all you have to do is paste it
# where you want it.
#
@magamig
magamig / .ghci
Created November 27, 2015 15:53
ghci personal settings file
import qualified IPPrint
import qualified Language.Haskell.HsColour as HsColour
import qualified Language.Haskell.HsColour.Colourise as HsColour
import qualified Language.Haskell.HsColour.Output as HsColour
let myColourPrefs = HsColour.defaultColourPrefs { HsColour.conid = [HsColour.Foreground HsColour.Yellow, HsColour.Bold], HsColour.conop = [HsColour.Foreground HsColour.Yellow], HsColour.string = [HsColour.Foreground HsColour.Green], HsColour.char = [HsColour.Foreground HsColour.Cyan], HsColour.number = [HsColour.Foreground HsColour.Red, HsColour.Bold], HsColour.layout = [HsColour.Foreground HsColour.White], HsColour.keyglyph = [HsColour.Foreground HsColour.White] }
let myPrint = putStrLn . HsColour.hscolour (HsColour.TTYg HsColour.XTerm256Compatible) myColourPrefs False False "" False . IPPrint.pshow
:set -interactive-print=myPrint
@magamig
magamig / Brogrammer.itermcolors
Created November 26, 2015 18:28
Brogrammer item color scheme with small color corrections.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.12343787401914597</real>
<key>Green Component</key>
<real>0.12343578040599823</real>