Skip to content

Instantly share code, notes, and snippets.

View Nephos's full-sized avatar
💭
migrated to git.sceptique.eu

Arthur Poulet Nephos

💭
migrated to git.sceptique.eu
View GitHub Profile

Keybase proof

I hereby claim:

  • I am Nephos on github.
  • I am sceptique (https://keybase.io/sceptique) on keybase.
  • I have a public key whose fingerprint is D030 5F28 FB0E 5FB9 17D8 C757 7964 62C9 03FA 7870

To claim this, I am signing this object:

@Nephos
Nephos / channel-select.md
Created December 19, 2020 13:28 — forked from bcardiff/channel-select.md
Blocking and non-blocking channel actions

Blocking and non-blocking channel actions

Channel#receive vs Channel#receive? differs on their behavior for closed channels. Using them directly is always blocking.

Performing an operation over a closed and closing the channel during the operation must behave in the same way.

Channel#receive

/**
* @example
* new SearchEngine(lines, { subfield: 'conditions' }).execute('key:value')
*/
class SearchEngine {
constructor(data, options = {}) {
this.data = data;
this.options = options;
}
@Nephos
Nephos / spell_convert.rb
Created May 22, 2020 07:51
Conversion d'une liste de sort (copié collé de pathfinder wiki) en csv
# coding: utf-8
require "json"
require "csv"
txt = File.readlines('spells.txt')
spells = []
current_level = 0
current_school = "none"
txt.each do |line|
if line.match? /^Sorts d.+ \d+$/
Number.prototype.times = function (callback) {
const collect = [];
for (let i = 0; i < this; i++) {
collect.push(callback(i, this));
}
return collect;
}
function htmlizeLeef(data, parent) {
const indent = (data.level - 1).times(i => "&nbsp;&nbsp;").join('');
require "json"
require "uri"
require "csv"
SLEEP = 3
errors = []
output_io = ARGV[1] ? File.open(ARGV[1], "w") : STDOUT
errors_io = ARGV[2] ? File.open(ARGV[2], "w") : STDERR
@Nephos
Nephos / gist:e7ad57cd10c7c19d6b43afd40a731a03
Created March 6, 2018 15:04
Fix your shit nodemotherfuckingjs
> const a = stuff
SyntaxError: Identifier 'a' has already been declared
> a
ReferenceError: a is not defined
>
#!/usr/bin/env ruby
module Base64
extend self
ALPHA = ('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a + %w(- /)
def encode(input, verbose = false)
bytes = text_to_bytes(input)
slice3 = bytes_to_slice3(bytes)
require "curb"
res = Curl.get "https://en.wikipedia.org/wiki/Intel"
require "nokogiri"
dom = Nokogiri::HTML.parse res.body
full_resume = dom.search(".infobox + p").text
resume = full_resume.split(".").first
require "curb"
res = Curl.get "https://en.wikipedia.org/wiki/Intel"
require "nokogiri"
dom = Nokogiri::HTML.parse res.body
full_resume = dom.search(".infobox + p").text
resume = full_resume.split(".").first