Skip to content

Instantly share code, notes, and snippets.

View hbt's full-sized avatar

Hassen Ben Tanfous hbt

View GitHub Profile
@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>
@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
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
// snippet to inject js code using chrome
// gg.js
// file should be in chrome directory to be accessed via extension
Post({
action: "Tab.loadCustomJS3"
});
# 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}
<!-- view ruby vrome -->
<textarea onkeyup="getLineNumberAndColumnIndex(this);" id="txt" rows="14" cols="60" style="background-color: black; color: white;">
asdsadh
das
d
d
chrome.runtime.getPackageDirectoryEntry(function (dir) {
window.dir = dir;
console.log(dir)
dir.getFile('version.txt', {}, function (fe) {
@hbt
hbt / cvimrc
Created February 4, 2017 19:54
" begin
" Copy paste this into options.html
" first lines copied into options
let configpath = '/home/hassen/.cvimrc'
let homedirectory = '/home/hassen'
" this would load this file into the options page
set localconfig
""""
" end
function main() {
{
let bb = doSomething1()
let mm = doSomething2(bb, 'ww')
}
function doSomething2(var1, var2) {
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y curl git python g++ build-essential python-pip ffmpeg sudo php7.0
# install youtube-dl
RUN pip install youtube-dl
# Install drive
RUN mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1