Skip to content

Instantly share code, notes, and snippets.

View duhruh's full-sized avatar
👽
Storming Area 51

David Rivera duhruh

👽
Storming Area 51
View GitHub Profile
@duhruh
duhruh / Dockerfile
Created July 10, 2019 00:07
Gui run in docker
# docker build -t gui .
FROM debian
RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install -y xserver-xorg xorg jwm
ENTRYPOINT ["startx"]
@duhruh
duhruh / main.go
Created March 26, 2019 04:20
findMedianSortedArrays
func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
i := 0
j := 0
combined := []int{}
for {
if i == len(nums1) || j == len(nums2) {
break
}
nettop -p com.docker.vpnk -x
<html>
<head>
<style>
.ribbon-list{
list-style: none;
}
.ribbon-list > li {
float: left;
margin-right: 20px;
@duhruh
duhruh / dhcpcd.conf
Last active February 23, 2019 21:02
router
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
#!/bin/sh
set -e
curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
func quickSort(ar []int) []int{
pivot := ar[rand.Intn(len(ar))]
less := []int{}
equal := []int{}
more := []int{}
for i := range ar {
class MyEntitiy {
private foo;
private bar;
function MyEntity(foo, bar){
this.setFoo(foo);
this.setBar(bar);
}
function setFoo(foo){
@duhruh
duhruh / about.html
Last active November 19, 2017 01:49
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Hi! I'm David, Go developer, Javascript developer, and i love working on opensource projects.">
<meta name="author" content="David Rivera">
<link rel="icon" href="http://www.gravatar.com/avatar/53c3e800211ecbf9e38c588f993c128e?s=200">
<title>David Rivera</title>
@duhruh
duhruh / gist:6e61bf0f36f43a4c93c886d7ad5f7a1c
Created November 3, 2017 17:34 — forked from thomas11/gist:2909362
Log memory usage every n seconds in Go #golang
import (
"runtime"
"time"
)
...
go func() {
for {
var m runtime.MemStats