Skip to content

Instantly share code, notes, and snippets.

@hebbian
hebbian / brdc.py
Created August 26, 2015 17:08
brdc.py for weechat
# Copyright (C) 2013 - Hebbian <idiotiquehebb@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...
var settings = {
baseurl : 'http://demo.tlevi.net/',
path: ....
...
@hebbian
hebbian / gist:9fb51f8113d147ca4f8d
Last active August 29, 2015 14:22
Get Base64 image file from file input with Angular
app.directive("fileread", [function () {
return {
scope: {
fileread: "="
},
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
var reader = new FileReader();
reader.onload = function (loadEvent) {
scope.$apply(function () {
io.on("connection", function(socket) {
console.log('A user connected');
socket.emit('message', { message: 'welcome to the chat' });
socket.on('send:message', function(data) {
console.log(data);
socket.emit('message', data);
});
});
@hebbian
hebbian / .vimrc
Last active April 13, 2016 01:46
.vimrc
" Run git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() " required
" core plugins
Plugin 'gmarik/Vundle.vim'
Plugin 'flazz/vim-colorschemes'
@hebbian
hebbian / Testing Gist
Created February 17, 2015 07:44
Testing Gist
- (void)testingGistAsSharedCode:(BOOL)param
{
if (param) {
NSLog(@"Yes, it is");
} else {
NSLog(@"It's useless");
}
}