Skip to content

Instantly share code, notes, and snippets.

<resources>
<!-- Style you can use with a container (typically a horizontal
LinearLayout) to get the standard "button bar" background and
spacing. @hide -->
<style name="ButtonBar">
<item name="android:paddingTop">5dip</item>
<item name="android:paddingStart">4dip</item>
<item name="android:paddingEnd">4dip</item>
<item name="android:paddingBottom">1dip</item>
<item name="android:background">@android:drawable/bottom_bar</item>
@Kozlov-V
Kozlov-V / andrlayout
Created April 21, 2013 16:15
Android layout, так, например, можно получить размеры
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Log.v("Log", "" + findViewById(R.id.qqq).getWidth());
}
}, 100);
@presci
presci / neo_handler_multipart.erl
Created December 28, 2012 17:47
extend/cowboy file upload
-module(neo_handler_multipart).
-behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/2]).
init({_Transport, http}, Req, []) ->
{ok, Req, {}}.
handle(Req, State) ->
{Result, Req2} = acc_multipart(Req),
@ToddG
ToddG / rebar-reltool-relase-notes.md
Created September 15, 2012 16:46
using rebar to create an erlang app with a dependency, and then starting a release created with reltool

Summary

I'm trying to figure out how to use rebar to:

  • create erlang project
  • add a dependency on an erlang module from github
  • start the app via the erl console
  • create a release and start the app from the release (via the generated scripts)
@egobrain
egobrain / cowboy_multipart_uploader.erl
Created May 30, 2012 06:47
Cowboy files uploader.
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
@egobrain
egobrain / upload_handler.erl
Created May 25, 2012 13:17
upload_handler
-module(upload_handler).
-behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/2]).
init({_Transport, http}, Req, []) ->
{ok, Req, {}}.
handle(Req, State) ->
{Method,Req2} = cowboy_http_req:method(Req),
case Method of
@lukaslundgren
lukaslundgren / python27_on_debian.sh
Created May 11, 2012 12:58
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
@egobrain
egobrain / file_upload_example.html
Created April 6, 2012 05:44
File upload example that uses new Browser HTML5 Upload API.
<style>
#dropZone {
color: #555;
font-size: 18px;
text-align: center;
width: 400px;
padding: 50px 0;
margin: 50px auto;
@rambocoder
rambocoder / boss_rebar.erl
Created April 4, 2012 18:46
Windows Support. Updated start-server.bat for ChicaboBoss skeleton, and ChicagoBoss\priv\rebar\boss_rebar.erl with windows support
%%%-------------------------------------------------------------------
%%% @author Jose Luis Gordo Romero <jgordor@gmail.com>
%%% @doc Chicago Boss rebar functions, called from boss_plugin
%%% Managing compilation/configuration/scripts stuff, the boss way
%%% @end
%%%-------------------------------------------------------------------
-module(boss_rebar).
-export([run/4,
help/0,
@cooldaemon
cooldaemon / process_vs_ets_vs_mnesia.erl
Created March 31, 2012 16:28
Process vs ETS vs Mnesia
-module(process_vs_ets_vs_mnesia).
-author('cooldaemon@gmail.com').
-export([run/3]).
-record(store, {key, value}).
run(TryCount, ProcessCount, ReadCount) ->
Pids = lists:map(
fun (_) -> spawn_link(fun reader_process/0) end,