Skip to content

Instantly share code, notes, and snippets.

Avatar

Basile Bruneau NTag

View GitHub Profile
@NTag
NTag / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View rapportIntermediaire.text
\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 / dnspvd.c
Last active May 12, 2016
PoC of draft-stenberg-mif-mpvd-dns-00 in C using ldns
View dnspvd.c
#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 / API Vevo
Created Jul 31, 2014
Some URL of Vevo API
View API Vevo
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?
@NTag
NTag / beautifulUbuntu.md
Last active Nov 17, 2018
Beautiful Terminal with Ubuntu 14.04 LTS
View beautifulUbuntu.md
  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
View color-font-awesome.js
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 / trainline-data-to-geojson.js
Last active Nov 27, 2019
Simple script example to create a GeoJSON of your Trainline trips using Raildar.
View trainline-data-to-geojson.js
// 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 => ({
@NTag
NTag / now_deezer.sh
Last active Sep 15, 2020
Display Deezer played track in tmux powerline segment
View now_deezer.sh
# Display current played track by Deezer Application
generate_segmentrc() {
read -d '' rccontents << EORC
EORC
echo "${rccontents}"
}
run_segment() {
@NTag
NTag / remoteAtom.md
Last active Sep 29, 2020
How to install and use remote-atom
View remoteAtom.md

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