Skip to content

Instantly share code, notes, and snippets.

View trodrigues's full-sized avatar
😸
:3

Tiago Rodrigues trodrigues

😸
:3
View GitHub Profile
@trodrigues
trodrigues / gist:8577343
Last active January 4, 2016 05:49
Contextual higher level classes affecting content of extends in SASS
// In some cases we might want to have the following in SASS:
.some-class-name {
width: 50%;
}
.under-a-specific-context {
.some-class-name {
width: 35%;
}
<?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>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
</dict>
<key>Label</key>
@trodrigues
trodrigues / gist:7598896
Created November 22, 2013 12:06
Fixing google multiple account login SNAFU

Google multiple account login tends to go crazy at times, and if you start logging in and out of accounts, all services start to log you out, log you in with the wrong user, or just go into a crazy loop where you login into one account and get logged out of the other. This is specially a problem if one of your accounts is a Google Apps account (like a work account) because some google services might be disabled for that account or they just work differently.

Here's how to fix it (maybe, it works for me):

  • Logout of all your accounts
  • Close your browser (seriously)
  • Open browser again (duh)
  • Login onto your personal account
  • Login onto with your personal account onto services which might be disabled on your work account or have weird login processes (youtube, g+, etc)
  • Login into your work account. Repeat for anything with the weird login processes
@trodrigues
trodrigues / gist:7414091
Last active August 30, 2019 03:24
Angular.js directive test example with service mocking
describe('Directive test', function () {
var container, scope;
var aStub;
beforeEach(function () {
aStub = sinon.stub();
module('testmodule', function ($provide) {
$provide.value('someService', aStub);
});
describe('Testing something', function () {
var container, scope;
beforeEach(function () {
inject(function ($rootScope, $compile) {
scope = $rootScope.$new();
scope.can = function () {
return false;
};
~ % mkdir stuff
~ % cd stuff
~/stuff % npm install gumbo-parser
npm http GET http://registry.npmjs.org/gumbo-parser
npm http 304 http://registry.npmjs.org/gumbo-parser
> gumbo-parser@0.0.3 install /Users/trodrigues/stuff/node_modules/gumbo-parser
> node-gyp rebuild
gyp http GET http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz
@trodrigues
trodrigues / gist:5687822
Created May 31, 2013 20:39
Go to http://www.feedly.com/home#index and run this. It'll tell you how many feeds you have on feedburner. Now I just need to automate unsubscribing these and subscribing the original urls.
var burners = [];
var feedEls = document.querySelectorAll('#feedlyPage > div > div.cell > div');
Array.prototype.forEach.call(feedEls, function(val){
var feedUrl = val.getAttribute('data-uri').replace(/^subscription\/feed\//g, '');
//console.log(feedUrl)
if(/\.feedburner/g.test(feedUrl) || /\.feedproxy/g.test(feedUrl)){
burners.push(feedUrl)
}
});
console.log(feedEls.length, burners.length)
# feeds
http://www.newsblur.com/
http://www.feedafever.com/#demo
http://blog.feedly.com/2013/03/14/google-reader/
http://theoldreader.com/
http://getprismatic.com/
https://feedbin.me/
[master] % git rebase somebranch
Cannot rebase: You have unstaged changes.
Please commit or stash them.
[master] % git status
# On branch master
nothing to commit, working directory clean
@trodrigues
trodrigues / diacriticsmap
Last active March 29, 2016 19:43
Diacritics in the OSX British/US keyboard (for Portuguese users or any other users of languages with diacritics)http://en.wikipedia.org/wiki/Diacritic
Mac OSX keyboard layout switching is a pain.
Using a keyboard layout different than the one actually printed on
your keys is also weird. The following keyboard shortcuts allow you
to create the various diacritics used in languages like Portuguese
on the British/US layout of a Mac keyboard.
Alt+e -> ´ Examples: é ó á
Alt+i -> ^ Examples: â ê
Alt+c -> ç