Skip to content

Instantly share code, notes, and snippets.

@jdtoy
jdtoy / Path-Analysis-Neo4j-Cypher.md
Created December 2, 2020 23:36 — forked from innat/Path-Analysis-Neo4j-Cypher.md
Path Analytics with CYPHER.

Viewing the graph

match (n:MyNode)-[r]->(m)

return n, r, m

Finding paths between specific nodes:*

@jdtoy
jdtoy / rpi4.boot-from-sd-rootfs-on-usb.md
Created October 16, 2020 20:50 — forked from lucabelluccini/rpi4.boot-from-sd-rootfs-on-usb.md
Raspberry Pi 4 - Boot from SD, Rootfs on USB

Raspberry 4B - Boot from SD and rootfs on USB

  1. Download Raspbian from the official site

  2. Flash it to the USB drive following the procedure detailed here

  3. Fomat an SD Card 2/4 GB as FAT32, label "boot", flag "lba". Generate a UUID. You can use GParted for this task.

  4. Get the UUID of the USB drive and the SD Card partitions using sudo blkid.

@jdtoy
jdtoy / neo4j_cypher_cheatsheet.md
Created January 12, 2019 11:01 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@jdtoy
jdtoy / gist:36d7fa8a6932fc9733ad
Created August 28, 2015 10:39
Batch Autocrop Images
mogrify -fuzz 15% -trim +repage *.jpg
@jdtoy
jdtoy / gist:bad48916f951a861ed92
Created February 5, 2015 21:11
Favicon Snippet
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 48x48 64x64" type="image/vnd.microsoft.icon">
function FBshares(url) {
var jsondata = UrlFetchApp.fetch("http://graph.facebook.com/"+url);
var object = Utilities.jsonParse(jsondata.getContentText());
return object.shares;
}
function Tweets(url) {
var jsondata = UrlFetchApp.fetch("http://urls.api.twitter.com/1/urls/count.json?url="+url);
var object = Utilities.jsonParse(jsondata.getContentText());
return object.count;
@jdtoy
jdtoy / blueprint
Created April 15, 2014 11:06
Error invoking start on brooklyn.entity.database.mysql.MySqlNode
name: My Web Cluster
location: aws-ec2:us-east-1
services:
- serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: My Web
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0-M2/brooklyn-example-hello-world-sql-webapp-0.6.0-M2.war
java.sysprops:
brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s",
import math
from dbfpy import dbf
import matplotlib.pyplot as plt
#create a plot
fig = plt.figure(1, figsize = [10,10], dpi=90)
axScatter = plt.subplot(111)
def candMedian(dataPoints):
#Calculate the first candidate median as the geometric mean
@jdtoy
jdtoy / gist:9529932
Last active August 29, 2015 13:57
Downgrading Jekyll to use CLI
wget --no-check-certificate https://github.com/mojombo/jekyll/archive/v0.11.2.tar.gz > jekyll-0.11.2.tar.gz
tar -zxf jekyll-0.11.2.tar.gz
tar -zxf v0.11.2.tar.gz
cd jekyll-0.11.2
gem build jekyll.gemspec
sudo gem install jekyll-0.11.2.gem
Installed in:
/Library/Ruby/Gems/2.0.0/gems/jekyll-0.11.2/bin/jekyll
@jdtoy
jdtoy / .bash_profile
Created March 11, 2014 18:44
Pretty Gitting.
source /usr/local/git/contrib/completion/git-completion.bash
source /usr/local/git/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=True
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH=${PATH}:$HOME/gsutil
MAGENTA="\[\033[0;35m\]"
YELLOW="\[\033[0;33m\]"