Skip to content

Instantly share code, notes, and snippets.

View alabarga's full-sized avatar

Alberto Labarga alabarga

View GitHub Profile
@alabarga
alabarga / test_gephi_lite.gexf
Created April 29, 2024 18:41
test_gephi_lite
<?xml version="1.0" encoding="UTF-8"?>
<gexf version="1.2" xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http:///www.gexf.net/1.1draft/viz">
<meta>
<title>hsa_circ_0005568.gexf</title>
<authors>NetworkX 3.2.1</authors>
</meta>
<graph defaultedgetype="directed">
<attributes class="node">
<attribute id="type" title="type" type="string"/>
<attribute id="degree" title="degree" type="integer"/>
@alabarga
alabarga / Fastai_Colab_GPU_test.ipynb
Created January 23, 2018 22:27 — forked from roycoding/Fastai_Colab_GPU_test.ipynb
fast.ai on Google Colaboratory with GPU test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alabarga
alabarga / process.ipynb
Created December 2, 2015 11:31 — forked from ruairif/process.ipynb
Data processing for daft.ie
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alabarga
alabarga / sparkr-demo
Created October 30, 2015 14:44 — forked from shivaram/sparkr-demo
SparkR 1.4.1 Demo
# If you are using Spark 1.4, then launch SparkR with the command
#
# ./bin/sparkR --packages com.databricks:spark-csv_2.10:1.0.3
# as the `sparkPackages=` flag was only added in Spark 1.4.1.
# # This will work in Spark 1.4.1.
sc <- sparkR.init(spark_link, sparkPackages = "com.databricks:spark-csv_2.10:1.0.3")
sqlContext <- sparkRSQL.init(sc)
flights <- read.df(sqlContext, "s3n://sparkr-data/nycflights13.csv","com.databricks.spark.csv", header="true")
@alabarga
alabarga / gmail_analyze.py
Created September 24, 2015 06:17 — forked from utsengar/gmail_analyze.py
Analyze gmail data
#Install scipy: http://glowingpython.blogspot.it/2012/05/analyzing-your-gmail-with-matplotlib.html
from imaplib import IMAP4_SSL
from datetime import date,timedelta,datetime
from time import mktime
from email.utils import parsedate
from pylab import plot_date,show,xticks,date2num
from pylab import figure,hist,num2date
from matplotlib.dates import DateFormatter
@alabarga
alabarga / .gitignore
Last active August 29, 2015 14:26 — forked from mbostock/.block
County Bubbles
.DS_Store
build
node_modules
@alabarga
alabarga / README.md
Last active August 29, 2015 14:07 — forked from chrisjacob/README.md

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

Learning Object Oriented Python

I wrote this as a guide for a financial analyst friend of mine looking to learn Python. He is already fairly well versed in doing Project Euler problems in Ruby. All italicized text is for the benefit of any other readers, such as yourself.

Each section is divided into a short resource (10 minutes or less), a long resource (days to weeks or more), and a challenge.

~

So what you're looking to do is to be able to recreate financial models in code. And other types of models. This is a noble pursuit.

/**
* Other transients stuff here http://www.catswhocode.com/blog/wordpress-transients-api-practical-examples
*/
function my_followers_count($screen_name = 'kovshenin'){
$key = 'my_followers_count_' . $screen_name;
// Let's see if we have a cached version
$followers_count = get_transient($key);
if ($followers_count !== false)
Facebook*:
https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
+ works, returns shares, likes, comments and total
Twitter:
http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
+ v1 API but still works
Reddit:
http://buttons.reddit.com/button_info.json?url=%%URL%%