Skip to content

Instantly share code, notes, and snippets.

View NTag's full-sized avatar

Basile Bruneau NTag

View GitHub Profile
@NTag
NTag / trainline-data-to-geojson.js
Last active November 27, 2019 11:09
Simple script example to create a GeoJSON of your Trainline trips using Raildar.
// npm install request request-promise
// ./data.json is Trainline Europe data export (ask the support)
// node trainline-data-to-geojson.js > trips.geojson
const fs = require('fs');
const rp = require('request-promise');
const computeGeojson = async () => {
const data = JSON.parse(fs.readFileSync('./data.json'), { encoding: 'utf8' });
const legs = data.pnrs.filter(pnr => pnr.status === 'emitted').map(pnr => pnr.legs.map(leg => ({
import { library } from '@fortawesome/fontawesome-svg-core';
import { faCloudSun } from '@fortawesome/free-solid-svg-icons';
import FontAwesomeIcon from '@ntag/react-fontawesome';
library.add(faCloudSun);
export const Weather = () => (
<div>
<h1>Weather</h1>
<FontAwesomeIcon icon="cloud-sun" fill={['#3C6997', '#EDFF71', '#F1DB4B']} />
@NTag
NTag / dnspvd.c
Last active May 12, 2016 13:38
PoC of draft-stenberg-mif-mpvd-dns-00 in C using ldns
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <ldns/ldns.h>
#include <arpa/inet.h>
#include "neat.h"
#include "neat_internal.h"
@NTag
NTag / remoteAtom.md
Last active December 19, 2023 12:09
How to install and use remote-atom

Installation

  1. Install Atom on your computer (https://atom.io)

  2. Launch Atom, go in Preferences, then chose Install, search for "remote-atom", and install it

  3. On the distant machine:

    cd ~
    wget https://raw.githubusercontent.com/aurora/rmate/master/rmate
    chmod +x rmate
@NTag
NTag / beautifulUbuntu.md
Last active November 17, 2018 13:51
Beautiful Terminal with Ubuntu 14.04 LTS
  1. Install ZSH
    • sudo apt-get install git zsh
  2. Install OhMyZSH
    • sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  3. Install zsh-autosuggestions
    • git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
    • Edit ~/.zshrc and replace line plugins=(git) with plugins=(git zsh-autosuggestions)
    • Create a file ~/.oh-my-zsh/custom/colors.zsh containing ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=240'
  4. Install zsh-syntax-highlighting
  • git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
@NTag
NTag / now_deezer.sh
Last active August 30, 2022 21:14
Display Deezer played track in tmux powerline segment
# Display current played track by Deezer Application
generate_segmentrc() {
read -d '' rccontents << EORC
EORC
echo "${rccontents}"
}
run_segment() {
\documentclass[11pt,french,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[french,noconfigs]{babel}
\usepackage[colorlinks=true]{hyperref}
\usepackage{csquotes}
\usepackage{polytechnique}
@NTag
NTag / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@NTag
NTag / API Vevo
Created July 31, 2014 17:30
Some URL of Vevo API
239.255.255.250
http://9cf9.v.fwmrm.net
http://api.twitter.com/1.1/
http://api.twitter.com/oauth/access_token
http://api.twitter.com/oauth/authenticate
http://api.twitter.com/oauth/authorize
http://api.twitter.com/oauth/request_token
http://api.vevo.com/mobile/v1/
http://api.vevo.com/mobile/v1/artist/
http://api.vevo.com/mobile/v1/artist/list.json?