Skip to content

Instantly share code, notes, and snippets.

View Shafaet's full-sized avatar

Shafaet Ashraf Shafaet

View GitHub Profile
//Programming Contest Template
//Shafaet Ashraf
#include <bits/stdc++.h>
#define stream istringstream
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define repv(i,n) for(int i=n-1; i>=0; i--)
#define repl(i,n) for(int i=1; i<=(int)n; i++)
#define replv(i,n) for(int i=n; i>=1; i--)
#define foreach(i,n) for(__typeof((n).begin())i =(n).begin();i!=(n).end();i++)
list=["user1",user2"]
list.each do |name|
h=Hacker.find_by_username(name)
m=Message.where(receiver_id: h.id)
puts h.id,m
end
#it will output only hackerid's if nobody sent any messages, otherwise it will print list of messages too
@Shafaet
Shafaet / dsldoc.md
Last active February 26, 2026 09:10 — forked from abhiranjankumar00/dslwiki.md
DSL Documentation