Skip to content

Instantly share code, notes, and snippets.

View escobar5's full-sized avatar
👾

Juan S. Escobar escobar5

👾
  • Intrena
  • Medellin, CO
View GitHub Profile
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active February 29, 2024 16:29
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@seejee
seejee / biggest_relations.sql
Last active February 22, 2024 14:12
Postgres Maintenance Scripts
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_relation_size(C.oid) DESC
LIMIT 20;
@suau
suau / shareWithoutFacebook
Created April 7, 2015 11:04
share text to android applications except facebook
public static void shareWithoutFacebook(Context context, String text) {
// get available share intents
List<Intent> targets = new ArrayList<>();
Intent template = new Intent(Intent.ACTION_SEND);
template.setType("text/plain");
List<ResolveInfo> resolveInfos = context.getPackageManager().
queryIntentActivities(template, 0);
// remove facebook which has a broken share intent
for (ResolveInfo resolveInfo : resolveInfos) {
@endel
endel / getMoonPhase.js
Created March 25, 2015 16:04
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@keyboardr
keyboardr / ParcelableUtils.java
Last active August 13, 2020 13:38
Utility class for dealing with Parcelables. Handles null checks for objects, and parcels some common non-Parcelable classes
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.os.Parcel;
import android.os.Parcelable;
@DamianEdwards
DamianEdwards / gist:4030394
Created November 7, 2012 09:31
Async site scraping in ASP.NET 4.5
public class SiteScrape : HttpTaskAsyncHandler
{
public override async Task ProcessRequestAsync(HttpContext context)
{
using (var http = new HttpClient())
{
var downloadTasks = new List<Task<string>> {
http.GetStringAsync("http://bing.com"),
http.GetStringAsync("http://google.com"),
http.GetStringAsync("http://oredev.org"),
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#