Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View uilian's full-sized avatar
🏠
Working from home

Uilian Souza uilian

🏠
Working from home
View GitHub Profile
git log --graph --pretty=oneline --abbrev-commit
@tetsuok
tetsuok / answer_pic.go
Created April 2, 2012 02:40
An answer of the exercise: Slices on a tour of Go
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
// Allocate two-dimensioanl array.
a := make([][]uint8, dy)
for i := 0; i < dy; i++ {
a[i] = make([]uint8, dx)
}
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@timyates
timyates / excel.groovy
Last active June 13, 2017 18:43
Create a styled Excel spreadsheet with Groovy and Apache POI
@Grab( 'org.apache.poi:poi:3.9' )
import static org.apache.poi.ss.usermodel.CellStyle.*
import static org.apache.poi.ss.usermodel.IndexedColors.*
import org.apache.poi.hssf.usermodel.HSSFWorkbook
new HSSFWorkbook().with { workbook ->
def styles = [ LIGHT_BLUE, LIGHT_GREEN, LIGHT_ORANGE ].collect { color ->
createCellStyle().with { style ->
fillForegroundColor = color.index
fillPattern = SOLID_FOREGROUND
@uilian
uilian / long-queries-progress.sql
Last active August 29, 2015 14:01
Oracle - Long query progress
--
-- Mostra o andamento de operacoes longas no Oracle.
--
select target, sofar, totalwork, ROUND((sofar/totalwork)*100,5) pct_done
from v$session_longops
where (sid, serial#) in (select sid, serial#
from v$session
where logon_time > trunc(sysdate))
order by pct_done;
@matthewtckr
matthewtckr / Pentaho_BA_Dockerfile
Last active August 29, 2015 14:02
Dockerfile to install Pentaho 5.1 from Archive Build with Plugins
############################################################
# Dockerfile to build Pentaho EE BA Server container images
# Based on Ubuntu 14.04
############################################################
FROM ubuntu:14.04
MAINTAINER Matt Tucker, matthewtckr@gmail.com
## Install Base Software
RUN apt-get update -y
@jzfgo
jzfgo / xvfb.service
Created July 8, 2015 17:07
Manage Xvfb (Virtual Framebuffer X Server) as a service for systemd based distros (CentOS 7, Ubuntu 15...)
[Unit]
Description=Virtual Frame Buffer X Server
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :42 -screen 0 1x1x24 -ac +extension GLX +render -noreset
[Install]
WantedBy=multi-user.target

@Pramati - HYD (16/07/2015)

  1. What is your role and responsibilities in your current project?
  2. Find common elements from two arrays? Without using any Ruby operator and tell me how would you write a program?
  3. How to find an element from an array? How it internally works?
  4. How to sort ruby objects based on particular object? For ex: [@user1, @user2, @user3, @user4] - Then sort it by user's salary.
  5. Explain MVC?
  6. What is the use of moving controller code to model?
  7. Tell me the internal flow of execution when I call some method? For ex: @object.some_method
@hidroh
hidroh / avd.sh
Last active November 16, 2023 11:31
Handy bash script to prompt for an Android virtual device (AVD) selection and launch it. Assuming that Android SDK has been set up and is in user PATH.
emulator -list-avds | cat -n
printf "Select AVD: "
read index
avd=$(emulator -list-avds | sed "${index}q;d")
echo "Selected $avd"
emulator -netdelay none -netspeed full -avd $avd
@kendallroth
kendallroth / print_github_markdown.md
Created March 22, 2017 14:10
Print GitHub Markdown

Print GitHub Markdown

Either create a browser snippet or execute from console:

var content = document.querySelector('.markdown-body');
var body = document.querySelector('body');
body.innerHTML = '';
body.appendChild(content);