Skip to content

Instantly share code, notes, and snippets.

View Nidal-Bakir's full-sized avatar
🏹
segmentation violation

Nidal Bakir Nidal-Bakir

🏹
segmentation violation
View GitHub Profile
@Nidal-Bakir
Nidal-Bakir / mimes.go
Last active March 9, 2025 13:30
Common MIME types as const in go-lang
// MIT License
//
// Copyright (c) 2025 Nidal Bakir
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / device_type.dart
Last active March 9, 2025 13:30
Device type (phone/tablet) and orientation (landscape/portrait)
// MIT License
//
// Copyright (c) 2025 Nidal Bakir
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / github_sections.md
Created July 8, 2024 23:45
github sections in md files

Simple alerts

Note

This is a note.

Tip

This is a tip. (Supported since 14 Nov 2023)

Important

Crutial information comes here.

@Nidal-Bakir
Nidal-Bakir / is_valid_interface.go
Last active June 29, 2024 23:30
Check if a Golang interface is valid (not nil) and does not point to a possibly nil value
func IsValidInterface(i interface{}) bool {
iv := reflect.ValueOf(i)
return iv.IsValid() && !iv.IsNil()
}
@Nidal-Bakir
Nidal-Bakir / falsehoods-programming-time-list.md
Created May 29, 2024 10:02 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@Nidal-Bakir
Nidal-Bakir / sliver_magic.dart
Last active May 8, 2024 16:58 — forked from slightfoot/sliver_magic.dart
SliversPersistentHeader in both directions (top,bottom) || Sliver Magic - by Simon Lightfoot - #HumpdayQandA - 19th July 2023 - #Flutter #Dart - https://www.youtube.com/live/zNOZD0JSFQY?feature=share&t=7315
// MIT License
//
// Copyright (c) 2023 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / notification_service.dart
Last active March 9, 2025 13:31
Flutter notification service
// MIT License
//
// Copyright (c) 2025 Nidal Bakir
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / scroll_parent_on_overflow.dart
Created March 27, 2024 18:03 — forked from slightfoot/scroll_parent_on_overflow.dart
Scroll Parent On Overflow - by Simon lightfoot - Humpday Q&A :: 20th March 2024 #Flutter #Dart - https://www.youtube.com/watch?v=qByAoUXOb2M
// MIT License
//
// Copyright (c) 2024 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / maps_launcher.dart
Last active March 9, 2025 13:31
Launch a ios/google native map app with lat,long and label
// MIT License
//
// Copyright (c) 2025 Nidal Bakir
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nidal-Bakir
Nidal-Bakir / dart_http_array.dart
Last active March 9, 2025 13:31
http-array format
// MIT License
//
// Copyright (c) 2025 Nidal Bakir
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: