Skip to content

Instantly share code, notes, and snippets.

@brauliobo
brauliobo / README.md
Last active May 19, 2020 09:50
Whatapp Web Group/Broadcast contacts to CSV export script

Usage

  1. Open group info
  2. Click more to show all group members
  3. Open Javascript console
  4. Paste the code

Gotchas

  • Admins aren't exported
  • Users without image cannot be exported
@brauliobo
brauliobo / build.prop
Created August 14, 2017 12:55
build.prop A520F/DS
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=NJH47F
ro.build.display.id=lineage_a5y17lte-userdebug 7.1.2 NJH47F dbd9ed3594 test-keys
ro.build.version.incremental=dbd9ed3594
ro.build.version.sdk=25
ro.build.version.preview_sdk=0
ro.build.version.codename=REL
ro.build.version.all_codenames=REL
@brauliobo
brauliobo / radiolog
Created August 13, 2017 22:41
radiolog A520F/DS
08-13 18:30:43.017 2553 2553 D boot : cbd: get_cmdline_str: find str androidboot.debug_level=0x4f4c form /proc/cmdline
08-13 18:30:43.017 2553 2553 D boot : cbd: check_debug_level: androidboot.debug_level=0x4f4c, 0
08-13 18:30:43.017 2553 2553 D boot : cbd: check_debug_level: debug level=0, cp_debug=0
08-13 18:30:43.017 2553 2553 D boot : cbd: main: Daemon Mode
08-13 18:30:43.017 2553 2553 D boot : cbd: main: SS310 modem
08-13 18:30:43.017 2553 2553 D boot : cbd: main: boot SHMEM link
08-13 18:30:43.017 2553 2553 D boot : cbd: main: main SHMEM link
08-13 18:30:43.017 2553 2553 D boot : cbd: main: partition number : platform/13540000.dwmmc0/by-name/RADIO
08-13 18:30:43.017 2553 2553 D boot : cbd: main: partition path : /dev/block/platform/13540000.dwmmc0/by-name/RADIO
08-13 18:30:43.017 2553 2553 I chatty : uid=1001(radio) /sbin/cbd expire 25 lines
#!/bin/bash
# Check if a value exists in an array
# @param $1 mixed Needle
# @param $2 array Haystack
# @return Success (0) if value exists, Failure (1) otherwise
# Usage: in_array "$needle" "${haystack[@]}"
# See: http://fvue.nl/wiki/Bash:_Check_if_array_element_exists
in_array() {
local hay needle=$1
@brauliobo
brauliobo / fluid-demo.html
Created October 8, 2015 14:23
Fluid demo with footer always on bottom and sidebar fixed.
<html>
<head>
<style>
body {
margin: 0; //overwrite browser
height: 100%;
}
.header {
background-color: #D0D0D0;
@brauliobo
brauliobo / unicorn.conf.rb
Last active November 21, 2020 19:06
Unicorn configuration with master warm up and other daemons as workers support. (See lastest and full version at https://github.com/coletivoEITA/noosfero-cookbook/blob/master/templates/default/unicorn.conf.rb.erb)
RailsRoot = File.expand_path "#{File.dirname __FILE__}/.."
PidsDir = "#{RailsRoot}/tmp/pids"
OldPidFile = "#{PidsDir}/unicorn.pid.oldbin"
ListenAddress = "127.0.0.1"
ListenPort = 50000
UnixListen = "tmp/unicorn.sock"
Backlog = 2048
Workers = 4
@brauliobo
brauliobo / correios.rb
Last active August 29, 2015 13:58
Cálculo do frete dos Correios usando Ruby/Rails/Nokogiri
# based on http://sounoob.com.br/consultar-frete-utilizando-webservice-dos-correios-php/
require 'rubygems'
require 'uri'
require 'net/http'
require 'active_support/all'
require 'nokogiri'
Pac = 41106
@brauliobo
brauliobo / gettext2rubyi18n.rb
Last active December 16, 2015 23:19
A script to convert your source code`s calls to _() (gettext) to t() (ruby i18n).
#!/usr/bin/env ruby
#
# https://gist.github.com/brauliobo/5512890
# Authors: Bráulio Bhavamitra <brauliobo@gmail.com> and Hugo Melo <hugo@riseup.net>
# License: GPLv3
#
# A script to convert your source code`s calls to _() (gettext) to t() (ruby i18n).
#
# Convert text string to a key along with the file path. Example:
# Call _('Name') into source views/profile/index.index output into config/locales/en.yml:
namespace :spork do
SPORK_PORT = (ENV['SPORK_PORT'] || 8988).to_i
FRAMEWORKS = %w[testunit rspec cucumber]
desc "Start all Spork frameworks"
task 'start' => FRAMEWORKS.map{ |f| "spork:#{f}:start" }
desc "Stop all Spork frameworks"
task 'stop' => FRAMEWORKS.map{ |f| "spork:#{f}:stop" }