Skip to content

Instantly share code, notes, and snippets.

View bcye's full-sized avatar
🚢
Shipping

Bruce bcye

🚢
Shipping
View GitHub Profile
@bcye
bcye / FormatJS Snippets.json
Last active July 6, 2023 16:00
VS Code Snippets
View FormatJS Snippets.json
{
"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 / keybase.md
Created January 21, 2020 09:58
keybase proof
View keybase.md

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 / 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
View index.html
<!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 / oootwitter_notes.md
Created April 25, 2019 00:26
Out of office for twitter notes
View oootwitter_notes.md

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
View sentry-dsym.sh
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"
View Sentry-AppDelegate.swift
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 {
View Sentry-Podfile
use_frameworks!
target 'placeholder' do
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '4.1.0'
end
View install-cocoapods.sh
sudo gem install cocoapods
cd #directory
pod init
@bcye
bcye / main.swift
Created April 3, 2018 10:42
How to call a function of a vc inside another vc.
View main.swift
//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: