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
complete -c crystal -n '__fish_crystal_no_subcmd' -fa compile -d "compile the specified file"
complete -c crystal -n '__fish_crystal_no_subcmd' -fa run -d "run the specified file as a program"
complete -c crystal -n '__fish_crystal_no_subcmd' -fa spec -d "run the unit test in ./spec"
complete -c crystal -n '__fish_crystal_no_subcmd' -fa docs -d "generate the documentation"
complete -c crystal -n '__fish_crystal_no_subcmd' -fa deps -d "install the dependencies"
complete -c crystal -n '__fish_crystal_no_subcmd' -fa env
complete -c crystal -n '__fish_crystal_no_subcmd' -fa eval
complete -c crystal -n '__fish_crystal_no_subcmd' -fa play
complete -c crystal -n '__fish_crystal_no_subcmd' -fa tool
complete -c crystal -n '__fish_crystal_no_subcmd' -fa help -d "display the help screen"
module Sort
def self.sort_bead(tab)
@c = 0
tab = _sort_bead_columns(
_sort_bead_columns(
tab.map{|e| [1] * e.abs}
)
).map(&:size)
return { complexity: @c, result: tab.reverse }
@Nephos
Nephos / journee
Last active July 30, 2016 13:59
robot for journee-mondale.com to get the current celebration
#!/usr/bin/env ruby
require "mechanize"
a = Mechanize.new
a.get "http://www.journee-mondiale.com/"
node_journee = a.page.at "#journeesDuJour"
titles = node_journee.search("h2").map{|n| "- #{n.text}"}
require "./DashBot/*"
require "CrystalIrc"
require "rollable"
module DashBot
def start
bot = CrystalIrc::Bot.new ip: "irc.mozilla.org", nick: "Dasshy", read_timeout: 300_u16
bot.on("JOIN") do |msg|
if msg.hl == bot.nick.to_s
#!/usr/bin/env ruby
# coding: utf-8
NAMES = {
"kalatz_a" => "Alexandre Kalatzis",
"poulet_a" => "Arthur Poulet",
"broggi_t" => "Thibaut Broggi",
"dispot_a" => "Lucie Dispot",
"dezeri_e" => "Emilie Dézériaud",
"douzie_l" => "Ludovic Douziech",
@Nephos
Nephos / keybase.md
Created February 28, 2017 08:20
keybase.md

Keybase proof

I hereby claim:

  • I am nephos on github.
  • I am nephos (https://keybase.io/nephos) on keybase.
  • I have a public key ASAGJnH8kORt3Y9uTVh1h2BJxsZNz6eC8NuQSlzI8LELMwo

To claim this, I am signing this object:

#!/usr/bin/env ruby
data = File.read(ARGV[0])
data.gsub!(/(\d\.\d\d)(\d+)/, '\1')
data.gsub!(/(\d\d\.\d)(\d+)/, '\1')
data.gsub!(/[[:space:]]+/, ' ')
data = data.split("\n").map(&:strip).join
File.write(ARGV[1], data)
#!/usr/bin/env ruby
# script pingtracer 0.1
# written by poulet_a
class PingError < StandardError; end
class ParseError < PingError; end
class Ping
#!/usr/bin/env sh
echo "Pirate flag raised" > /tmp/vulnerable
echo "Pirate flag raised: true"
echo
class Array
def average
self.sum / self.size.to_f
end
def sum
self.reduce(0) { |l, r| l + r }
end
# TODO: check