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
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@veuncent
veuncent / docker_debugging.md
Last active February 21, 2024 00:58
Debugging Django apps running in Docker using ptvsd - Visual Studio (Code)

Remote debugging in Docker (for Django apps)

In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):

  1. Add ptvsd to your requirements.txt file
ptvsd == 4.3.2
  1. To your launch.json, add this:
@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)
}
@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
@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
@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);
@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

@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
git log --graph --pretty=oneline --abbrev-commit
@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