Skip to content

Instantly share code, notes, and snippets.

View hbt's full-sized avatar

Hassen Ben Tanfous hbt

View GitHub Profile
# map ma :call vrome('ma')<CR>
# map 'a :call vrome("'a")<CR>
('a'..'z').to_a.map{|i| "map m#{i} :call vrome('m#{i}')<CR>" }.each{|i| puts i}
('0'..'9').to_a.map{|i| "map m#{i} :call vrome('m#{i}')<CR>" }.each{|i| puts i}
('a'..'z').to_a.map{|i| "map '#{i} :call vrome(\"'#{i}\")<CR>" }.each{|i| puts i}
('0'..'9').to_a.map{|i| "map '#{i} :call vrome(\"'#{i}\")<CR>" }.each{|i| puts i}
// snippet to inject js code using chrome
// gg.js
// file should be in chrome directory to be accessed via extension
Post({
action: "Tab.loadCustomJS3"
});
This file has been truncated, but you can view the full file.
-----BEGIN PGP MESSAGE-----
Comment: https://keybase.io/download
Version: Keybase Go 1.0.18 (linux)
wcBMA86irnjzmSQ9AQgALBhnLWPQtn9dgDfiJdpBejkL/90SuIgKTF6RtDPVfDmk
BEfG2TGPwzNwKeFCJkraJjF1xrTVJEue1ZjzQu1Wp1oUxKfx3mA5/YrsCotOxDAS
rNJATiwP7kHcC03kfcw9vRcy8oKUOZ8fkonH+PyukKY0idJ2h+5OC/RMnbFLds7B
x4ZWtuM+WCLHxtNPPqfaQEXjx/YYuerdivHn2LBvwN+P5covVAnU5wBPUtk1lOti
2GoOXkn26Iaoqh04/+xnioHAakunQTMwQRUdyglKvYZRNuS8Yh307OuzkKKpoKdN
RCwu/dIEiyeadakLGilsbc87mGn+EbJRwXgloNs5ftLgAeQvoUA8O7/7Bkr/2LPJ
@hbt
hbt / 0_reuse_code.js
Created December 6, 2016 17:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hbt
hbt / code-snippets.txt
Last active December 26, 2016 11:29
chromium improvement notes
sample code to write file using chromium api
read/write file example that works in renderer but not in webkit
'content/browser/renderer_host/render_widget_host_view_base.cc:34'
//#include <iostream>
//#include <fstream>
//#include <cstdlib>
//#include <fstream>

Keybase proof

I hereby claim:

  • I am hbt on github.
  • I am hbt (https://keybase.io/hbt) on keybase.
  • I have a public key whose fingerprint is B5EF 5804 CB7E F892 CF5C 0F97 C962 EE71 1DD5 255E

To claim this, I am signing this object:

@hbt
hbt / medium-tmp-post-problem-elimination.md
Created December 20, 2015 17:49
The difference between solving a problem and eliminating it

The difference between solving a problem and eliminating it

There is a lot of talk about incremental improvements vs innovation and companies calling themselves "disruptive".

What we should be asking:

  • What is the root problem we are trying to eliminate?
  • Where does the solution fit in the grand scheme of things?
  • How far are we from actually eliminating the problem?
@hbt
hbt / netflix-ratings-export.js
Created June 27, 2014 19:31
export netflix ratings by saving html pages using pentadactyl
with(window.content.window)
{
// start page
localStorage['minc'] = localStorage['minc'] || 1
function main()
{
// only run on ratings page
@hbt
hbt / gist:2324282
Created April 7, 2012 00:33
script to align code without using a parter + tokenizer
# add("zi", Zoom["in"]);
# add("zo", Zoom.out);
# add("zm", Zoom.more);
# add("zr", Zoom.reduce);
# add("zz", Zoom.reset);
#
# add("zI", Zoom.current_in);
# add("zO", Zoom.current_out);
#
# add("zM", Zoom.current_more);
@hbt
hbt / underscore.coffee
Created January 6, 2012 19:26
underscore in coffeescript
# **Underscore.coffee
# (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.**
# Underscore is freely distributable under the terms of the
# [MIT license](http://en.wikipedia.org/wiki/MIT_License).
# Portions of Underscore are inspired by or borrowed from
# [Prototype.js](http://prototypejs.org/api), Oliver Steele's
# [Functional](http://osteele.com), and John Resig's
# [Micro-Templating](http://ejohn.org).
# For all details and documentation:
# http://documentcloud.github.com/underscore/