Skip to content

Instantly share code, notes, and snippets.

@madevelopers
madevelopers / readzip.go
Created January 29, 2015 09:36
golang: Read zip file
package main
import (
"archive/zip"
"fmt"
"io/ioutil"
)
type myCloser interface {
Close() error
@madevelopers
madevelopers / .editorconfig
Last active June 29, 2017 07:26
My preffered editorconfig settings
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# Interactive operation...
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Default to human readable figures
alias df='df -h'
alias du='du -h'
# Misc :)
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.1-1
# ~/.bashrc: executed by bash(1) for interactive shells.
# This function defines a 'cd' replacement function capable of keeping,
# displaying and accessing history of visited directories, up to 10 entries.
# To use it, uncomment it, source this file and try 'cd --'.
# acd_func 1.0.5, 10-nov-2004
# Petar Marinov, http:/geocities.com/h2428, this is public domain
cd_func ()
{
local x2 the_new_dir adir index
local -i cnt
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.1-1
# ~/.bash_profile: executed by bash(1) for login shells.
@madevelopers
madevelopers / bash: git prompt
Last active January 2, 2016 04:29
My preferred bash prompt colors with gitprompt.
# This is my bash prompt is a copy on my eOS machine.
# load git prompt
# download it here: https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
if [ "$color_prompt" = yes ]; then
PS1='\n${debian_chroot:+($debian_chroot)}\u@\h:\e[36m\w\e[95m$(__git_ps1)\e[39m\n\$ '
else
PS1='\n${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1)\n\$ '
@madevelopers
madevelopers / gist:7817848
Created December 6, 2013 02:51
HTML5: Download text file
<a href="data:text;charset=utf-8,Content" download="filename.txt">Download file</a>
<!-- Content must be encoded: encodeURIComponent("Sample Content") -->
@madevelopers
madevelopers / sublime: plugins
Last active December 27, 2015 13:09
list of my favorite sublime text plugins
DocBlockr
Emmet
GitGutter
Better Coffeescript
Indent XML
Sidebar Enhancements
Plain Tasks
Tomorrow Color Schemes
Theme Soda
Sublime Linter
@madevelopers
madevelopers / sublime: Default.sublime-keymap
Last active December 27, 2015 12:59
My sublime key bindings
[
{ "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" },
{ "keys": ["alt+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"} }
]