Skip to content

Instantly share code, notes, and snippets.

View taniki's full-sized avatar
🛠️

tam kien duong taniki

🛠️
View GitHub Profile
settings
def export_synapse():
syn = synapseclient.Synapse()
syn.login()
project = syn.get("syn2483395")
d = Dataset( "%s:27017" % (mongodb_host) )
revisions = d.find({ "url" : { "$regex" : "en/Crimea/revision/([0-9]*)$" } }, { "url":1, "dataset": 1 })
@taniki
taniki / Dockerfile
Created April 30, 2014 14:50
Dockerfile to build a wekeypedia api container
FROM phusion/baseimage
RUN apt-get update
RUN apt-get install -y -q software-properties-common python-software-properties python g++ make
RUN add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y -q nodejs
@taniki
taniki / import.py
Created April 3, 2014 12:29
import wikipedia visits dataset to neo4j
import json
import requests
dataset = "data/wkp-steps.20140402.json"
neo4j_endpoint = "http://localhost:7474/db/data/cypher"
pages = set()
users = set()
visits = []
@taniki
taniki / gist:9668398
Last active August 29, 2015 13:57
Twitter Policy

Tweets & RTs

Don't

  • pas de RT de RT de ses propres tweets
  • pas de RT juste parce que quelqu'un mentionne le truc sauf intérêt spécial
  • engager la conversation mais ne pas RT les réponses
  • pas de RT systématique des autres comptes du CRI
  • PAS DE "c'est quoi ton problème, mec ?"
@taniki
taniki / main.py
Last active January 1, 2016 07:29
a small script to extract a network structure from a set of concepts using wikipedia pages blue link structure $ python main.py test-networks.txt
import sys
import json
import wikipedia
import networkx as nx
from networkx.readwrite import json_graph
from colorama import Fore, init
@taniki
taniki / Dockerfile
Created September 12, 2013 20:10
docker builder : cortext-aut
FROM ubuntu:12.10
# https://github.com/dotcloud/docker/issues/1024
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q mysql-server
RUN apt-get install -y php5-cli php5-mysql php5-curl php5-sqlite
RUN apt-get install -y git
@taniki
taniki / Dockerfile
Created September 9, 2013 14:54
docker builder : cortext-projects
FROM ubuntu:12.10
RUN apt-get install -y curl git
RUN curl https://install.meteor.com | /bin/sh
RUN git clone https://github.com/cortext/cortext-projects
EXPOSE 3000:3000
@taniki
taniki / gist:5133358
Last active December 14, 2015 18:59
how to get anti-alias with R (and knitr) under ubuntu

I had to switch to a personal ubuntu PC lately. I already tried to get anti-alias in R outputs on my ubuntu workstation but failed and relied on an imac to get pixel perfect plot (ggplot2 <3). The latter one use QUARTZ by default and I tried to install quickly Cairo but it was not very simple and did not got time to fix it. Now that I have to, I did it. It is a minor problem and I am sure it will help other ubuntu R users (:

The problem is that :

  • install.packages("Cairo") outputs dependencie errors without telling explicitly how to fix them (particulary libxt)
  • apt-get install r-cran-cairo does install something but it does not appear in R and does not fetch dependencies either

Then in the terminal, you will first need to :

@taniki
taniki / List of installed modules.md
Last active December 12, 2015 03:18
my basic sublime text config
  • Package controller
  • Emmet
  • GitGutter
  • SublimeREPL