Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
timelyportfolio / code.R
Last active November 29, 2018 16:45
start to work on combining d3 venn and sankey with R tables and igraph
library(dplyr)
library(pipeR)
library(htmltools)
Titanic %>>%
data.frame %>>%
( .[,c(1,2,3,5)] ) %>>%
#tbl_df %>>%
(df ~
lapply(
@lawlesst
lawlesst / rdflib_stardog.py
Last active July 14, 2021 03:38
Example code for working with Stardog from Python.
"""
Example code for connecting to Stardog (http://stardog.com/) with
Python's RDFLib (http://github.com/rdflib).
See longer description: http://lawlesst.github.io/notebook/rdflib-stardog.html
"""
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active June 3, 2024 06:00
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@jvilledieu
jvilledieu / Reshipping scam detection.adoc
Last active July 22, 2019 12:15
A neo4j gist on reshipping and retail fraud.
@withr
withr / server.R
Last active January 8, 2025 22:43
Encrypt password with md5 for Shiny-app.
library(shiny)
library(datasets)
Logged = FALSE;
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad")
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
source("www/Login.R", local = TRUE)
observe({
if (USER$Logged == TRUE) {
@revolunet
revolunet / d3.js.md
Last active October 14, 2022 02:40
D3.js ressources collection
@mplewis
mplewis / flask-uwsgi-nginx-primer.md
Last active August 3, 2025 16:54
Flask + uWSGI + nginx Primer. I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
@snipe
snipe / inputrc
Created April 17, 2013 16:44
~/.inputrc for nice bash history up-arrows. This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /". Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@lawlesst
lawlesst / vivordfalchemy.py
Last active June 29, 2017 19:05
Reading and writing RDF for VIVO using RDFAlchemy.
import csv
from pprint import pprint
import urllib
from rdflib import Namespace
from rdfalchemy import rdfSingle
from rdfalchemy.rdfSubject import rdfSubject
from rdflib import Literal, BNode, Namespace, URIRef
from rdflib import RDF, RDFS, Graph, OWL
@ngs
ngs / README.mkdn
Created August 31, 2012 09:18
Create Events on Google Calendar with Git Commit

Create Events on Google Calendar with Git Commit

Requirements

  • google-api-python-client
  • oauth2
  • rfc3339

Set up