Skip to content

Instantly share code, notes, and snippets.

View yasalmasri's full-sized avatar

Yaser Almasri yasalmasri

View GitHub Profile
class_id student_id staff_id
0001 9
0001 10059
0001 10084
0001 10077
0001 1003
0001 10079
0001 10024
0001 1004
0001 10047
class_id class_name description building_id term_id
0001 Biomedical Science 185 Published, No subterm association 3
0002 Business 424 Published, No subterm association 4
0003 Engineering 533 Published, One or more active subterm association 3 3300
0004 Architectural Technology 596 Published, One or more active subterm association 4 3300
0005 Biological Science 122 Published, Only past subterm associations 1 3200
0006 Health Science 439 Published, Only past subterm associations 1 3200
0007 Law 187 Published, Only future subterm associations 3 3400
0008 Arts 533 Published, Only future subterm associations 3 3400
0009 Nursing 223 Unublished, No subterm association 2
staff_id staff_first_name staff_last_name staff_email
1 Kieth Streich [email protected]
2 Neil Gibson [email protected]
3 Marisela Langworth [email protected]
4 Jaunita VonRueden [email protected]
5 Rickie Mills [email protected]
6 Lurlene Johns [email protected]
7 Hettie McKenzie [email protected]
8 Savannah Boehm [email protected]
9 Luigi Goldner [email protected]
student_id student_first_name student_last_name student_email
1001 Kurt Leuschke [email protected]
1002 Jacob Rosenbaum [email protected]
1003 Daryl Torp [email protected]
1004 Trudy Braun [email protected]
1005 Jacquelin King [email protected]
1006 Ira Gleason [email protected]
1007 Trudi Stiedemann [email protected]
1008 Jean Reilly [email protected]
1009 Yuette Lueilwitz [email protected]
@yasalmasri
yasalmasri / compound_interest.rb
Created December 13, 2023 21:51
compound_interest.rb
require 'amazing_print'
def interest(amount:, rate:, months:, years:)
a = amount
1.upto(years) do
1.upto(months) do |month|
a += a * rate/months
a += amount
end
end
@yasalmasri
yasalmasri / CurrencyField.swift
Last active September 25, 2022 05:13
Currency Field SwiftUI
//
// ContentView.swift
// CurrencyField
//
// Created by Yaser Almasri on 24/09/22.
//
import SwiftUI
struct ContentView: View {
require 'rest-client'
require 'json'
require 'yaml'
require 'amazing_print'
require 'erb'
require 'csv'
requests = YAML.load_file('requester.yml')
def render(template, vars)
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end

Need to calculate interest for monthly and annually investments:

  • Every month I create an investment with an $XXX amount.
  • All investments are for 1 year with XXX% percentage.
  • Each investment will be recreated with the amount and the gained intereset for example: Year 1: I invest $1000 MXN Year 2: I earn $1100 MXN, I recreate the investment with the amount $1100 MXN and so on for the next years
  • All the monthly investments will be treated the same way.
  • Need to calculate all the interest after XXX date and consider that the last year will only save the monthly amount not investing it.
@yasalmasri
yasalmasri / delete-channel-messages.js
Created June 25, 2018 18:37 — forked from firatkucuk/delete-slack-messages.js
Deletes slack public/private channel messages.
var https = require('https');
// CONFIGURATION #######################################################################################################
var token = 'SLACK TOKEN';
var channel = 'CHANNEL ID';
var privateChannel = false;
var delay = 300; // delay between delete operations in millisecond
// GLOBALS #############################################################################################################