Skip to content

Instantly share code, notes, and snippets.

@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@paulmach
paulmach / serve.go
Last active July 20, 2024 04:04
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@ianhanniballake
ianhanniballake / PlayerService.java
Created July 12, 2015 18:57
Minimal MediaSessionCompat needed to get RemoteControlClient to appear
package com.example.remotecontrolclient;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.media.AudioManager;
import android.os.IBinder;
import android.support.v4.media.MediaMetadataCompat;
@nguyendangminh
nguyendangminh / favicon.ico.go
Last active August 21, 2023 16:05
Serve favicon.ico in Golang
...
func faviconHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "relative/path/to/favicon.ico")
}
...
func main() {
http.HandleFunc("/favicon.ico", faviconHandler)
}
@diegoy
diegoy / MaskWatcher.java
Last active November 22, 2021 08:41
Apply masks to Android's Edit text adding this TextWatcher
/*
MIT License
Copyright (c) 2016 Diego Yasuhiko Kurisaki
*/
/* Example:
mEmailView.addTextChangedListener(new MaskWatcher("###-##"));
*/
import android.text.Editable;
@teocci
teocci / AwesomeCourses.md
Last active July 22, 2024 19:49
List of awesome university courses for learning Computer Science!

Awesome Courses Awesome

Introduction

There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lectures, notes, readings & examinations available online for free.

Table of Contents

@gauravbarthwal
gauravbarthwal / Multi-Part zip extraction in Ubuntu.txt
Last active July 22, 2024 20:45
How to extract multi-part .zip, .z01, .z02 files in ubuntu
Download/Copy all related *.zip files in one directory.
Open terminal and change to that directory which has all zip files.
Enter command zip -s- FILE_NAME.zip -O COMBINED_FILE.zip
Enter unzip COMBINED_FILE.zip
@matthewjberger
matthewjberger / instructions.md
Last active July 22, 2024 20:47
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@nikhita
nikhita / update-golang.md
Last active July 19, 2024 17:55
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: