Skip to content

Instantly share code, notes, and snippets.

View hackrio1's full-sized avatar

Hackrio hackrio1

  • Hackrio
  • Gurugram
View GitHub Profile
class User < ApplicationRecord
# Include default devise modules. Other Avaialavbles are:
# :confirmable, :lockable, :timeoutable, and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
gem 'bcrypt', '~> 3.1.7'
gem 'devise'
{
_id: STUDENT_IDname: STUDENT_NAME,
data_of_birth: STUDENT_DATE_OF_BIRTH,
courses: [
{
code: COURSE_CODE,
instructor: COURSE_INSTRUCTOR,
},
{
code: COURSE_CODE,
#include <stdio.h>
void bubble_sort(int a[], int n) {
int i = 0, j = 0, tmp;
for (i = 0; i < n; i++) { // loop n times - 1 per element
for (j = 0; j < n - i - 1; j++) { // last i elements are sorted already
if (a[j] > a[j + 1]) { // swop if order is broken
tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
<html>
<head>
<style>
p {
color: #000000;
}
</style>
</head>
</html>