Skip to content

Instantly share code, notes, and snippets.

View inakidelamadrid's full-sized avatar
🎯
Focusing

Ignacio De La Madrid inakidelamadrid

🎯
Focusing
  • Cymatic Security
  • Guadalajara, México
View GitHub Profile

Keybase proof

I hereby claim:

  • I am inakidelamadrid on github.
  • I am borealsummit (https://keybase.io/borealsummit) on keybase.
  • I have a public key ASC2DffMikqAfXKy8yRJKzn8fVXNpohLvPb3EpdllFvBDgo

To claim this, I am signing this object:

@inakidelamadrid
inakidelamadrid / DateQuery.js
Created July 26, 2017 19:20
Querying MongoDB. Querying by date range and sorting based on date field
db.getCollection('user_sessions').find({ "$and":[
{"created_at": {"$ne": null}},
{"created_at": { $gte : new ISODate("2017-07-12T00:00:00Z") }}
]})
.sort({"created_at": -1})
@inakidelamadrid
inakidelamadrid / 0_reuse_code.js
Created July 26, 2017 19:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
class TodoApp < Sinatra::Base
get '/tareas' do
@tareas = [{"tit" => "Leer", "hecho" => false, ["tit"=>"correr", "hecho" => false]}
end
if __FILE__ == $0
run!
end
end
@inakidelamadrid
inakidelamadrid / show_sql.py
Created October 5, 2015 15:17
How to check SQL queries in Django shell
# use sql_with_params method
Account.objects.values_list('id').query.sql_with_params()
Account.objects.all().query.sql_with_params()
@inakidelamadrid
inakidelamadrid / django-json-serialize.py
Created October 2, 2015 15:20
Django Views - How to serialize an array of django objects into flat JSON (exclude model, pk, and fields node)
import json
from django.forms.models import model_to_dict
from django.core.serializers.json import DjangoJSONEncoder
events = [some django model query]
# convert every object into a dictionary
data = map(lambda evt: model_to_dict(evt), events)
return HttpResponse(json.dumps(data, cls=DjangoJSONEncoder),
content_type="application/json")
# Remove recursively all .origi files
find . -name '*.orig' -delete

Keybase proof

I hereby claim:

  • I am inakidelamadrid on github.
  • I am inakidelamadrid (https://keybase.io/inakidelamadrid) on keybase.
  • I have a public key whose fingerprint is F85C 4E5A 842A 2DA2 AA82 C613 268A AA2C 2950 268C

To claim this, I am signing this object:

Write a program that implements Caesar's Cipher.
The alphabet is
(a b c d e f g h i j k l m n o p q r s t u v w x y z ? !)
Encode the following messages with a displacement of 1
hello world!
mocking bird