Skip to content

Instantly share code, notes, and snippets.

View rockwellll's full-sized avatar
🏠
Working from home

Ahmed Khattab rockwellll

🏠
Working from home
View GitHub Profile
import React, { Component } from "react";
import { connect } from "react-redux";
import {
Animated,
View,
FlatList,
TouchableWithoutFeedback,
Image,
ScrollView,
AsyncStorage,
// random things
import gql from 'graphql-tag';
import camelCase from 'camelcase';
import ApolloClient from 'apollo-client';
import { pluralOf, pascalCaseOf } from '../utils';
/**
*
* @param {String} schema
* @param {ApolloClient} client
*/
class MultiplicationTable
def initialize(from:, to:)
@from = from
@to = to
end
def print_multiplication_table
(@from..@to).each do |number|
puts multiplication_table_for number
end
def fizzbuzz(last_number:)
(1..last_number).each do |number|
if (number % 15).zero?
puts "FizzBuzz"
elsif (number % 5).zero?
puts "Buzz"
elsif(number % 3).zero?
puts "Fizz"
else
puts number
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:path_provider/path_provider.dart';
class FirebaseCloudWrapper {
FirebaseStorage _storage = FirebaseStorage(
storageBucket: "gs://sapphire-restaurant.appspot.com/",
class CartService
include ActiveModel::Attributes
include ActiveModel::Validations
attr_accessor :cart
validates_presence_of :cart
def initialize(cart:)
@cart = cart
import 'dart:convert' as json;
import 'package:dio/dio.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uni_capstone_project/models/patient.dart';
enum Result {
SUCCESS,
FAILED,
}
class TodoFacade
include ActiveModel::Validations
attr_reader :todo_set, :todos
validates_presence_of :author
def initialize(todo_set:)
@todo_set = todo_set
@todos = @todo_set.books
#!/usr/bin/env bash
# resetting and seeding the database
echo "[ bin/ci ] migrating the test database"
bin/rails db:migrate:reset RAILS_ENV=test
echo "[ bin/ci ] Running rspec tests"
bin/bundle exec rspec spec