Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Generated schema for Root",
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"type": "object",
"properties": {
@nmeylan
nmeylan / kube-logs.sh
Created July 10, 2019 12:53
tail kubernetes logs
#!/bin/sh
kubectl get pods -n NAMESPACE | grep -o -e .*${1}[\-a-z0-9]* | while read line; do kubectl logs -f $line -n NAMESPACE -c ${1} --tail 100; done
@nmeylan
nmeylan / main.js
Created August 29, 2018 09:00
Audio only youtube
$(document).ready(function() {
$("ytd-thumbnail").remove();
$("img").remove();
$("ytd-topbar-logo-renderer").remove();
$(".html5-video-container").remove()
})
$(document).scroll(function() {
$("ytd-thumbnail").remove();
$("img").remove();
@nmeylan
nmeylan / ag_districts.geojson
Created February 22, 2018 15:41
USDA Agriculture Districts
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmeylan
nmeylan / main.js
Created August 24, 2017 08:04
Auto reconnect websocket
import VueWS from 'vue-native-websocket'
import Observer from 'vue-native-websocket/src/Observer'
import App from './App'
import store from './store'
const wsOptions = {store: store, format: 'json'}
Vue.use(VueWS, "myWsEndpoint", wsOptions)
require "oga"
input = "" # sms backup xml file
output = "" #sms export txt file
file = File.open(input, "r:UTF-8")
from_hash = {"1" => "From", "2" => "Me"}
messages = []
document = Oga.parse_xml(file)
document.xpath("allsms/sms").each do |node|
messages << "#{from_hash[node.get(:type)]} (#{node.get(:time)}): #{node.get(:body)}".encode("UTF-8")
#!/usr/bin/env ruby
FORBIDDEN_WORDS = ['Table of contents', 'define', 'pragma'].freeze
def should_skip_line?(line)
!line.start_with?("#") || FORBIDDEN_WORDS.any? { |word| line =~ /#{word}/ }
end
File.open(ARGV[0], 'r') do |f|
in_code_block = false
@nmeylan
nmeylan / ruby-prof-kcachegrind.rb
Created June 8, 2015 14:20
ruby-prof-kcachegrind
require "ruby-prof"
result = RubyProf.profile do
# code here
end
printer = RubyProf::CallTreePrinter.new(result)
printer.print(File.open("output", "w+"))
@nmeylan
nmeylan / osx_term
Created February 21, 2015 14:05
Config osx terminal
https://www.dropbox.com/s/yvhfbies1ubcn9a/ConfigAuxPetitsOignons.terminal?dl=0
@nmeylan
nmeylan / eg
Created February 19, 2015 14:04
Keep vim bundle in git repository
git submodule init
git submodule add git://github.com/tpope/vim-fugitive.git bundle/vim-fugitive
git commit -m 'Added vim-fugitive'
git push