Skip to content

Instantly share code, notes, and snippets.

Avatar

maxlath maxlath

View GitHub Profile
View .aliases
# Initialize the array of favs
source ~/.favs
# Create an alias for each of the favs
for key in $favs
do
directory="$favs[$key]"
alias $key="cd $directory"
done
@maxlath
maxlath / test_sorting.js
Last active Feb 23, 2020
testing performance of sorting with or without pre-sorting
View test_sorting.js
#!/usr/bin/env node
// Environment
// ------------------
// NodeJS: v12.14.0
// CPU: 2.50GHz
// arrays length = 1000 (that is, sorting 1000^2 elements)
// Results
// ------------------
@maxlath
maxlath / decaffeinate_cleanup.js
Last active Nov 10, 2019
completing bulk-decaffeinate and eslint --fix
View decaffeinate_cleanup.js
#!/usr/bin/env node
// To be run after bulk-decaffeinate is done
// bulk-decaffeinate convert --num-workers 8 --config ~/bulk-decaffeinate.config.js
// cleanup(){
// decaffeinate_cleanup.js "$@" && npm run lint-fix "$@"
// }
//
// cleanup **/*.js
@maxlath
maxlath / index.html
Created Nov 3, 2016
allow to add MediaChain as a search engine
View index.html
<!doctype html>
<html>
<head>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="MediaChain Search" />
</head>
<body></body>
</html>
@maxlath
maxlath / brunch watch --debug logs
Created Mar 2, 2016
brunch watch --debug logs
View brunch watch --debug logs
> brunch watch --debug
brunch:speed Created BrunchWatcher 12552ms +0ms
brunch:application Trying to load brunch-config +5ms
brunch:speed Loaded config 14882ms +2s
brunch:speed Loading plugins 14883ms +1ms
brunch:speed Loaded plugin auto-reload-brunch 15471ms +588ms
brunch:speed Loaded plugin clean-css-brunch 17367ms +2s
brunch:speed Loaded plugin coffee-script-brunch 17428ms +62ms
brunch:speed Loaded plugin css-brunch 17430ms +1ms
@maxlath
maxlath / app.js
Created Mar 2, 2016
app.js missing the templates/confirmation_modal file
View app.js
(function() {
'use strict';
var globals = typeof window === 'undefined' ? global : window;
if (typeof globals.require === 'function') return;
var modules = {};
var cache = {};
var aliases = {};
var has = ({}).hasOwnProperty;
@maxlath
maxlath / magneto.rq
Last active Jan 30, 2016
Magneto - SPARQL Super villain
View magneto.rq
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX ns: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?prop ?value
WHERE {
<http://dbpedia.org/resource/Magneto_(comics)> ?prop ?value
}
LIMIT 500
View Sublime Text 3 - Key Bindings - User
[
{ "keys": ["ctrl+,"], "command": "show_panel", "args": {"panel": "console", "toggle": true}},
{ "keys": ["ctrl+t"], "command": "new_file" },
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["f12"], "command": "reindent"},
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } },
{ "keys": ["ctrl+alt+w"], "command": "prompt_select_workspace" },
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
{ "keys": ["f5"], "command": "refresh_folder_list" },
View potter_spec.rb
# Kata: http://wiki.agile-france.org/cgi-bin/wiki.pl?KataPotter
def calculateur_prix(livres)
# comptons combien d'exemplaires de chaque tomes d'Harry Potter la liste
# compte en incrémentant la case du tableau associé au numéro du tome
tableau_tome = [0,0,0,0,0]
livres.each { |tome| tableau_tome[tome] += 1 }
# trions le tableau optenu (comptant le nombre de chaque tome) par ordre
@maxlath
maxlath / tweetdeck url expander
Created Jan 8, 2014
getting over the anoying t.co redirection with the greasemonkey addon [forked from http://userscripts.org/scripts/show/160938]
View tweetdeck url expander
// ==UserScript==
// @name Tweetdeck url expander
// @namespace tweetdeck.twitter.com
// @description getting over the t.co redirection
// @include https://tweetdeck.twitter.com/
// @version 1
// @grant none
// ==/UserScript==
(function (window) {
var document = window.document;
You can’t perform that action at this time.