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 / gist:c808d9c0d9c363b545af
Created October 6, 2014 20:46
debug your CSS layers
//http://arqex.com/939/learning-much-javascript-one-line-code
[].forEach.call($$("*"),function(a){
a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)
})

Keybase proof

I hereby claim:

  • I am duhruh on github.
  • I am duhruh (https://keybase.io/duhruh) on keybase.
  • I have a public key whose fingerprint is 60F4 A259 7C4C A693 634A D851 4168 B590 F23D 8236

To claim this, I am signing this object:

@duhruh
duhruh / Dockerfile
Created December 29, 2015 02:00
Ruby-2.3 Dockerfile
FROM buildpack-deps:jessie
ENV RUBY_MAJOR 2.3
ENV RUBY_VERSION 2.3.0
ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507
ENV RUBYGEMS_VERSION 2.5.1
# skip installing gem documentation
RUN echo 'install: --no-document\nupdate: --no-document' > "$HOME/.gemrc"
def self.my_dynamic_method(lang)
class_eval %Q{
def #{lang}
# your code here
end
}
end
[:english, :french, :gangster].each do |lang|
my_dynamic_method lang
Listen 80
<VirtualHost *:80>
DocumentRoot "/www/helloPHP"
ServerName hello.hostdime.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/www/worldPHP"
ServerName world.hostdime.com
</VirtualHost>
@duhruh
duhruh / uhh.go
Created September 15, 2017 04:10
type thing struct{
uhh string
}
type GetMe func() string
type mystructThing struct {
BasicBoilerPlateShit <- this is embeded
}
mything := mystructThing{BasicBoilerPlateShit: library.NewBasicBoilerPlateShit()}
@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
@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>
class MyEntitiy {
private foo;
private bar;
function MyEntity(foo, bar){
this.setFoo(foo);
this.setBar(bar);
}
function setFoo(foo){