Skip to content

Instantly share code, notes, and snippets.

View mrcasals's full-sized avatar
👨‍🚀
🚀

Marc Riera mrcasals

👨‍🚀
🚀
View GitHub Profile
@burgalon
burgalon / AccountAuthenticator.java
Last active July 15, 2023 08:29
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@cmod
cmod / minimal_fb_messenger.css
Last active February 15, 2022 19:11
Minimal Facebook Messenger for Fluid
/*
Minimal Facebook Messenger
==========================
1. Make a Fluid (http://fluidapp.com/) instance of https://facebook.com/messages/
1. a. (You need to buy the paid version of Fluid to modify UserStyles)
2. Apply the below CSS as a Userstyles stylesheet
3. Like magic, you can now message without all the cruft of Full Facebook

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@otobrglez
otobrglez / Article.rb
Created July 12, 2011 20:51
Finding related articles using Jaccard index and tags
# This method finds related articles using Jaccard index (optimized for PostgreSQL).
# More info: http://en.wikipedia.org/wiki/Jaccard_index
class Article < ActiveRecord::Base
def related(limit=10)
Article.find_by_sql(%Q{
SELECT
a.*,
( SELECT array_agg(t.name) FROM taggings tg, tags t
@frontendbeast
frontendbeast / sm-annotated.html
Last active June 25, 2020 13:57 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine, updated to include IE8 support. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@fxn
fxn / back.html
Last active March 16, 2020 09:02
<div class="card"><div class="content">{{Back}}</div></div>
@sztupy
sztupy / INSTALL.md
Last active April 4, 2018 07:49 — forked from namuol/INSTALL.md

rage-quit plugin for oh-my-zsh

based on rage-quit support for bash

HOW TO INSTALL

Put the files below inside ~/.oh-my-zsh/custom/plugins/fuck

Also chmod a+x the flip command.