Skip to content

Instantly share code, notes, and snippets.

View bcye's full-sized avatar
🚢
Shipping

Bruce bcye

🚢
Shipping
View GitHub Profile
@bcye
bcye / main.swift
Created April 3, 2018 10:42
How to call a function of a vc inside another vc.
//Inside the main vc i put a function like this
//Function fetches data and calcs the total
func changeNavTitle() {
//[...]
// It does some stuff and then updates navigation label (you can change this to another label)
titleNav.title = "\(sum)\(currencySymbol)"
fetchedResultsController.changedContent = false
}
//Inside the other vc I call the function like this:
sudo gem install cocoapods
cd #directory
pod init
use_frameworks!
target 'placeholder' do
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '4.1.0'
end
import Sentry
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Create a Sentry client and start crash handler
do {
Client.shared = try Client(dsn: "yourDNS")
try Client.shared?.startCrashHandler()
} catch let error {
if which sentry-cli >/dev/null; then
export SENTRY_ORG=yourorg
export SENTRY_PROJECT=yourproject
export SENTRY_AUTH_TOKEN=yourtoken
ERROR=$(sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
if [ ! $? -eq 0 ]; then
echo "warning: sentry-cli - $ERROR"
fi
else
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
@bcye
bcye / oootwitter_notes.md
Created April 25, 2019 00:26
Out of office for twitter notes

Out of Office for Twitter [XXX]

Idea

Replies to every mention (or reply) with a message saying they are out of office, when they will be back, and an email they can reach out to for important messages.

The email can be their own or automatically generated by the service and just be forwarding the emails.

Pricing

  • Free if you include an ad for the service in your tweets.
  • Priced on a per use basis to remove ads from the website, your tweets and enable the option to make an email forward
  • option for flatrate for frequent users
@bcye
bcye / index.html
Last active June 18, 2019 04:18
A simple example of how to align navigation bar items to the right in Bootstrap 4. https://youtu.be/1noKaM4VGss
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
@bcye
bcye / keybase.md
Created January 21, 2020 09:58
keybase proof

Keybase proof

I hereby claim:

  • I am bcye on github.
  • I am br2020 (https://keybase.io/br2020) on keybase.
  • I have a public key ASB2L-qaeKy-K2R2ndBITDx1opQPI9tLW1GLzxkTta-LAwo

To claim this, I am signing this object:

@bcye
bcye / FormatJS Snippets.json
Last active July 6, 2023 16:00
VS Code Snippets
{
"Imperative Message": {
"scope": "javascript,typescript,javascriptreact,typescriptreact",
"prefix": "imsg",
"body": "intl.formatMessage({ defaultMessage: '$1' })$0"
},
"Message Component": {
"scope": "javascriptreact,typescriptreact",
"prefix": "fmsg",
"body": "<FormattedMessage defaultMessage={'$1'} />$0"
@bcye
bcye / README.md
Last active September 14, 2024 18:21
Make ics events recurring

ETH myStudies ics Script

This script is intended to be used with the ics files outputted by myStudies, to make importing your schedule into your calendar easier.

myStudies does not export recurring events, but instead individual events for every date. This makes it hard if you want to edit them, because you can't edit them as a series.

Usage

Call this script with these arguments:

  1. input ics file
  2. output ics file name
  3. start date of events to be considered (choose exactly one week, all events in the given timeframe will be kept with the added weekly recurrence rule)