Skip to content

Instantly share code, notes, and snippets.

View pvivera's full-sized avatar

Pablo Vivera pvivera

View GitHub Profile
@pvivera
pvivera / .gitconfig
Created September 24, 2019 17:56 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@pvivera
pvivera / RavenDbTests.cs
Created November 21, 2014 22:40
RavenDB workaround for query with filter on long fails 2
using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
namespace TestRaven
{
public class RavenDbTests : RavenTestBase
{
@pvivera
pvivera / RavenDBLongQuery.cs
Created October 28, 2014 12:47
RavenDB workaround for query with filter on long fails
public class RavenDbTests : RavenTestBase
{
[Fact]
public void Hi()
{
var store = NewDocumentStore();
store.ExecuteIndex(new SomeIndex());
using (var session = store.OpenSession())
public class User
{
public string Username { get; set; }
public bool Active { get; set; }
}
public class Group
{
public string Name { get; set; }
public List<User> Users { get; set; }
@pvivera
pvivera / categories.coffee
Created November 19, 2012 01:12
ClasificadosOnline Scrapping Excercise Coffeescript version (based on https://gist.github.com/4107569)
http = require 'http'
options = {
host: 'query.yahooapis.com'
port: 12
path: '/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fclasificadosonline.com%2Fm%2FMiscellaneosSearchM.asp%22%20and%0A%20%20%20%20%20%20xpath%3D%27%2Fhtml%2Fbody%2Fdiv%2Fdiv%2Fdiv%2Fform%2Fselect%27&format=json&diagnostics=true&callback='
method: 'GET'
}
req = http.get(options, (httpObj) ->
@pvivera
pvivera / last_timeline_and_mentions_and_email_them.rb
Created October 19, 2011 20:47
Get latest timeline and mentions then email them
require 'rubygems'
require 'gmail'
require 'twitter'
USERNAME = {GMAIL_USERNAME}
PASSWORD = {GMAIL_PASSWORD]
TWITTER_USER = {TWITTER_USERNAME}
LAST_TIMELINE_TWEET_FILE = 'last_timeline_tweet_id.txt'
LAST_MENTION_TWEET_FILE = 'last_mention_tweet_id.txt'