Skip to content

Instantly share code, notes, and snippets.

View hashemi's full-sized avatar
👨‍💻
Learning

Ahmad Alhashemi hashemi

👨‍💻
Learning
View GitHub Profile
import SwiftUI
struct ContentView: View {
@State var tapped: Bool = false
var width: CGFloat { tapped ? 300 : 60 }
var color: Color { tapped ? .red : .yellow }
var body: some View {
Button(action: { tapped.toggle() }) {
//
// ViewController.swift
// Counter
//
// Created by Ahmad Alhashemi on 11/24/20.
//
import UIKit
class ViewController: UIViewController {
@hashemi
hashemi / JSONSerialization2.swift
Created February 25, 2017 05:09
Modified copy of Apple's Swift implementation of the JSONSerialization class that parses numbers as Decimal's instead of Int's or Double's
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
// This is a modified copy which does deserialization only (no serialization) and

Keybase proof

I hereby claim:

  • I am hashemi on github.
  • I am hashemi (https://keybase.io/hashemi) on keybase.
  • I have a public key ASDDkIvdSwq7ys4Y8Z35CNsZufzmkq0GKKxcKbXCzLMj0Qo

To claim this, I am signing this object:

Incident Identifier: 72426EB6-2790-4DFF-B831-E4522EB427F6
CrashReporter Key: 03f103bc6b7539c8ea41f3592d9cfbeb80969b98
Hardware Model: iPhone7,2
Process: EEE [22436]
Path: /var/containers/Bundle/Application/5606EA84-03CC-43B6-8AA2-7DCF4F7716E7/EEE.app/EEE
Identifier: com.mdtext.EEE
Version: 5 (1.0.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Incident Identifier: 36D8CC49-FAFF-4A7D-8263-781D5C127961
CrashReporter Key: 03f103bc6b7539c8ea41f3592d9cfbeb80969b98
Hardware Model: iPhone7,2
Process: EEE [22474]
Path: /var/containers/Bundle/Application/5D7076C7-09A3-4B3C-AD90-B66F527C2057/EEE.app/EEE
Identifier: com.mdtext.EEE
Version: 5 (1.0.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
# This python script uninstalls packages
# installed using the OS X .pkg format.
#
# Run the script, passing the name of the
# pkg as the first command line argument.
#
# Depends on send2trash:
# $ pip install send2trash
#
# (c) Ahmad Alhashemi, 2015
# Takes a PubMed ID (PMID) and your email and returns
# a citation more or less in Vancouver style.
#
# Depends on biopython:
# $ pip install biopython
#
def citation(PMID, email):
from Bio import Entrez
Entrez.email = email