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
type mystructThing struct {
BasicBoilerPlateShit <- this is embeded
}
mything := mystructThing{BasicBoilerPlateShit: library.NewBasicBoilerPlateShit()}
@duhruh
duhruh / uhh.go
Created September 15, 2017 04:10
type thing struct{
uhh string
}
type GetMe func() string
Listen 80
<VirtualHost *:80>
DocumentRoot "/www/helloPHP"
ServerName hello.hostdime.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/www/worldPHP"
ServerName world.hostdime.com
</VirtualHost>
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
@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"

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 / 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)
})
autodetach on
shell -${SHELL}
defscrollback 2024
startup_message off
hardstatus on
vbell off
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
//issue a token, with an expiration date
var jwt = require('jsonwebtoken')
//issue token that expires after 10 mins AND has an issuer
var token = jwt.sign('helloworld','secret',{ expiresInMinutes : 10, issuer : 'hipster.io'});
//verify token, but don't check assertions.
authenticate : function(req,res){
var username = req.param('username')
var password = req.param('password')
if(!username || !password){
return res.json(403,{err : 'username and password required'})
}
User.findOneByUsername(username,function(err,user){