Skip to content

Instantly share code, notes, and snippets.

View aadilayub's full-sized avatar

Aadil Ayub aadilayub

View GitHub Profile
@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@jackinside
jackinside / TickTickProviderHelper
Last active October 9, 2023 14:56
A utility class to work with TickTick's Content Provider. A full guide is available at https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
/**
* This class provides the URI, const values and some methods to work with TickTick's Content Provider.
*
* A guide is available on https://docs.google.com/document/d/1zo0JdIWnQWi-D0v7xikknEnsLj4RmrzOuqzScdR_tm8
*/
public class TickTickProviderHelper {
private static final Uri TASK_URI = Uri.parse("content://com.ticktick.task.data/tasks");
private static final Uri PROJECT_URI = Uri.parse("content://com.ticktick.task.data/tasklist");
private static final String TASK_CONTENT_ITEM_TYPE = "vnd.android.cursor.item/ticktick.task.task";
@ed-flanagan
ed-flanagan / Popcorn-Time.desktop
Last active August 28, 2024 21:30
Gnome Popcorn Time application launcher
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Popcorn Time
Name[en_US]=Popcorn Time
GenericName=BitTorrent Stream Player
GenericName[en_US]=BitTorrent Stream Player
Comment=Run the Popcorn Time application
Comment[en_US]=Run the Popcorn Time application
Type=Application
@robertknight
robertknight / epubjs-selection-highlight-event-notes.md
Last active June 9, 2020 09:35
ePubJS customized embedding notes

epub.js is working on integrating Hypothesis into their reader. Although ePub content is HTML and therefore they can use Hypothesis' existing code for annotating web content, their reader is somewhat different than a typical web page and consequently the built-in method of scrolling to an annotation when the user selects it in the sidebar does not work.

epub.js' reader consists of viewer controls, with an <iframe> in the middle of the page, which displays the HTML for the current chapter. The <iframe> can be set to be the full height of the document.

The current integration works by embedding Hypothesis in the outer document, and also loading Hypothesis into the <iframe> but only loading Annotator.Guest in the <iframe> instead of the sidebar. The guest then connects to the sidebar in the host document.

@iamniels
iamniels / Server side printing with Google Cloud Print API from a PHP application.md
Created April 15, 2016 09:59
Server side printing with Google Cloud Print API from a PHP application

Server side printing with Google Cloud Print API from a PHP application

It took me quite some time to figure out how to print properly from a web application. I will explain here how I did it, so you don't have to spend the same time.

Authorization

Google Cloud Print API uses OAuth 2.0 for authorization.

As explained [here][1] on the Google Developer page, the best way to use OAuth with the Google API is with a Google service account. Create a service account as explained on the Google Developer page.

To use OAuth a library is required. Google has published the [Google API PHP client library][2]. If you want to use the examples from the Developer pages, you need to use version 1 of the library. In this article I use version 2 of the library.

@pau1m
pau1m / alicesButton.js
Created March 8, 2017 16:08
alices_button
<html>
<head>
<title>Introduction to Dapps. Simple MetaMask example.</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut vestibulum diam. Nam varius eros eu dui molestie, et dignissim orci pellentesque. Praesent in ultrices magna. Fusce placerat eu nibh ut maximus. Nulla laoreet diam ac est congue, et varius ligula sollicitudin. Donec eu mi et sem hendrerit rhoncus vitae eu quam. Phasellus dictum congue erat. Etiam rutrum vel est eget mollis. Praesent volutpat turpis mi, id molestie sapien auctor consequat. Aenean laoreet elit ut lacus suscipit, sit amet fringilla orci dictum. Nam eget rhoncus neque. Vestibulum blandit eu ex a mattis.
</p>
<div id="meta-mask-required"></div>
<fieldset>
@maqboolkhan
maqboolkhan / perfect-loki.sh
Last active July 23, 2018 06:11
How to install perfect Elementary OS loki
# To run $ sh perfect-loki.sh
# update repositories
sudo apt-get update
# Removing apps
echo '\n[?]Do you want to remove Epiphany Browser? [Y/n] '
read answer
if echo "$answer" | grep -iq "^n" ;then
echo '[>>>>>>>>>>>>>>>>>>>>] Not removing Epiphany Browser'
@neauoire
neauoire / josh.md
Last active October 20, 2019 17:23

For Josh Castle

You seem very stable mentally and emotionally, at least from the outside. Is that an accurate perception? Or is that just how you appear through the lens of social media?

It's possible that I am, but the way I see it, I might have less of an emotional dynamic range than some people, I definitely also oscillate between better and worse moods, but less intense highs and lows.

You track lots of things about yourself; do you also track your mood? And do you make an effort to fight it or to stabilize it, or do you just try to "go with the flow" and let your mood dictate your workflow?

I don't track my moods, but as my moods usually follow my tracked input/output, so moods can be inferred. I am happiest when I get to dedicate myself fully to any one task. So, that being said, tracking the way I do, can be seen as stabilizing my moods? I never have professional frustration, and I can very easily imagine that affecting my moods. To go with the flow, you have to be able to see the fl

@ej-mitchell
ej-mitchell / revolutionary-reading-list.md
Last active October 28, 2024 00:14
Reading list for understanding the harms of capitalism and US imperialism.

Radical Reading List

Notes

The primers are such because they are small and accessible books. They are challenging reads, since they fit a bunch into a tiny footprint, but they are great for the broad strokes of understanding the US's role in oppression and genocide both within our country and worldwide.

It is important to know that sexism and racism are pieces to the larger picture of oppression, which is why some books about those topics are added to the deeper dives.

Resources on Marxism and anarchy are provided as starting points, but by no means cover all the alternatives to capitalism. I personally identify as an anarchist. After having read more into the Marxist-Leninist school of thought, I realized I could not condone the creation of a State - to me, power and hierarchy are what have caused the problems we see today. The more I am a part of the anarchist community, especially one where ecological stewardship and social liberation are combined, I realize that the kind of future we desperately

@solarkraft
solarkraft / custom.css
Last active March 2, 2024 12:08
Logseq custom.css for publishing
/*** Publishing: Hide things that aren't very useful for a read-only view */
/** Hide page properties (public pages will always have public: true) */
.content .pre-block { display: none; }
/** Title */
/* Make title non-editable */
#main-container .page-title { pointer-events: none; }
/** Hide useless sidebar stuff */