Skip to content

Instantly share code, notes, and snippets.

Gilles Quenot sputnick-dev

Block or report user

Report or block sputnick-dev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sputnick-dev
sputnick-dev / retrieveCssOrXpathSelectorFromTextOrNode.js
Created Apr 1, 2018
retrieve CSS or Xpath selector from text or HTML node
View retrieveCssOrXpathSelectorFromTextOrNode.js
// ==UserScript==
// @name retrieveCssOrXpathSelectorFromTextOrNode
// @namespace gilles<dot>quenot<at>sputnick<dot>fr
// @version 0.2
// @description retrieve CSS or Xpath Selector from text or node for chrome dev tools
// @author Gilles Quenot
// @include https://*
// @include http://*
// @include file://*
// @exclude https://mail.google.com/*
View generate ssh key pair using bash as default shell
[test@localhost ~]$ echo 'eval $(ssh-agent)' >> ~/.bash_profile
[test@localhost ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_rsa):
Created directory '/home/test/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id_rsa.
Your public key has been saved in /home/test/.ssh/id_rsa.pub.
The key fingerprint is:
View request_node.js
var request = require("request");
var cheerio = require("cheerio");
request({
uri: "https://99bitcoins.com/bitcoin-rich-list-top100/#addresses",
}, function(error, response, body) {
var $ = cheerio.load(body);
var obj = {};
$("table.t99btc-rich-list tr").each(function(i, elem) {
View top_xbt.js
const puppeteer = require('puppeteer');
let scrape = async () => {
const browser = await puppeteer.launch({headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']});
const page = await browser.newPage();
await page.goto('https://99bitcoins.com/bitcoin-rich-list-top100/#addresses');
await page.waitFor(1000);
View EOF
cat<<'EOF'
foo
bat
$HOME
EOF
foo
bat
$HOME
View alert_on_non_ascii_url.user.js
// ==UserScript==
// @name alert_on_non_ascii_url
// @namespace sputnick
// @include https://*
// @include http://*
// @version 2
// @grant none
// @run-at document-start
// ==/UserScript==
View capture.js
var page = require('webpage').create();
//viewportSize being the actual size of the headless browser
page.viewportSize = { width: 1024, height: 768 };
//the clipRect is the portion of the page you are taking a screenshot of
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 };
//the rest of the code is the same as the previous example
page.open('http://phantomjs.org/screen-capture.html', function() {
page.render('capture.png');
console.log('Check capture.png');
phantom.exit();
View tuto.txt
Comme je viens de terminer les poly de ma RS, je vous propose un petit tuto sans prétention pour donner un coup de propre à votre belle de piste.
Soyons clairs, le but n’est pas de réaliser une peinture de concours, mais juste de faire quelque chose de propre sans y laisser une paye…
Voila le point de départ c’est une 250RS avec une robe pas très fraîche, quelques séquelles de chutes, et une peinture bien cracra…:affraid:
Pour virer l’ancienne peinture (et ses coulures) j’attaque au papier de verre grain 120 à sec (à la calle ou à la feuille) :
[img]http://sputnick.fr/%5BTUTO%5D%20Peindre%20ses%20poly%20%C3%A0%20la%20bombe_files/dsc05749mediumxs5.jpg[/img]
[img]http://sputnick.fr/%5BTUTO%5D%20Peindre%20ses%20poly%20%C3%A0%20la%20bombe_files/dsc05741mediumdh6.jpg[/img]
View markdown_keyboard_shortcuts.user.js
// ==UserScript==
// @name SO_like_keyboards_shortcuts
// @namespace sputnick
// @include https://github.com/*
// @include https://gist.github.com/*
// @include https://*.slack.com/*
// @include https://stackoverflow.com/*
// @include hhttps://serverfault.com/*
// @include https://*stackexchange.com/*
// @include https://askubuntu.com/*
View stackedit
to-markdown#28ffe20ede public/res/bower-libs/to-markdown
module.js:328
throw err;
^
Error: Cannot find module 'bower'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
You can’t perform that action at this time.