Skip to content

Instantly share code, notes, and snippets.

# How to consume Github Package private registry with yarn?
Create an .npmrc file in the same location as the package.json with this content.
```
registry=https://registry.yarnpkg.com/
@<username>:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<your auth token>
always-auth=true
@nomi-san
nomi-san / README.md
Last active January 29, 2024 09:57
Appear offline on League Client

Guides

Run offlol.bat as administrator to appear offline, with any arg to appear online.

$ offlol.bat
Please run as administrator.

admin $ offlol.bat
You will appear offline on League Client.
@rogerluan
rogerluan / String+Regex.swift
Created July 27, 2020 02:26
Handy Regex utility to find and replace matching groups in Swift.
extension String {
/// Finds matching groups and replace them with a template using an intuitive API.
///
/// This example will go through an input string and replace all occurrences of "MyGreatBrand" with "**MyGreatBrand**".
///
/// let regex = try! NSRegularExpression(pattern: #"(MyGreatBrand)"#) // Matches all occurrences of MyGreatBrand
/// someMarkdownDocument.replaceGroups(matching: regex, with: #"**$1**"#) // Surround all matches with **, formatting as bold text in markdown.
/// print(someMarkdownDocument)
///
/// - Parameters:
@dynamicMemberLookup
struct Template {
var template : String
private var data : [String:String]
var populatedTemplate : String { data.reduce(template) { $0.replacingOccurrences(of: "${\($1.key)}", with: $1.value) } }
init(template: String, data: [String:String] = [:]) {
self.template = template
self.data = data
}
@DrBrad
DrBrad / Add_to_Files.java
Last active September 8, 2022 02:06
Android Media WebView Notifications
//-------- add this to webview ----------
wv.setWebChromeClient(new webChromeClient());
wv.addJavascriptInterface(new JSInterface(), "JSOUT");
//----- add this to manifest under </activity> -----
<receiver android:name=".NotificationPausePlay" />
@niw
niw / ios11_uinavigationbar_behavior.md
Last active January 3, 2024 11:35
A note of my observation about iOS 11 UINavigationBar behavior.

UINavigationBar on iOS 11

NOTE This note is written based on Xcode version 9.0 beta 6 (9M214v) and its simulator binary.

iOS 11 changes UINavigationBar a lot, not just only for its large title, but also the internal view hierarchy and lay outing views are changed. This is a small note about UINavigationBar behavior on iOS 11, mainly focusing on migrating the application to iOS 11.

Lay outing views

UINavigationBar has been using manual lay outing until iOS 10, so all its content views like titleView has been directly child view of the UINavigationBar. However, since iOS 11, it is using auto layout with bunch of layout guides to lay out its content views in its own internal container view, _UINavigationBarContentView.

@jimthedev
jimthedev / MinHeightView.js
Created January 30, 2017 19:10
eventually will be react-native-dims
// Note: This is a very simple example
// Typically the deviceHeight would be most useful inside of a scrollview's contentContainerStyle
// or some other view whose parent has no height itself. minheight in react native needs a parent
// to have a height.
//
import React, {Component} from 'react';
import {
Text,
View
} from 'react-native';
@KevinKelchen
KevinKelchen / Xcode8AutomaticSigning.md
Last active May 7, 2019 13:04
iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

These are the steps our team used to get Xcode 8's Automatic Signing working for our iOS app. We felt it would be valuable to share this with the community (particularly given the effort it required us to get it working). While our research yielded some valuable information from others, it wasn't as simple as it sounded. We figured that we're not alone. 😄

For reference, these were some of the resources that proved valuable to us:

These steps presume that you have some understanding of iOS code signing and familiarity w

@burgalon
burgalon / DraggableModal.js
Created March 31, 2016 06:18
Draggable React Bootstrap modal
import { Modal } from 'react-bootstrap'
import ModalDialog from 'react-bootstrap/lib/ModalDialog'
class DraggableModalDialog extends React.Component {
render() {
return <Draggable handle=".modal-title"><ModalDialog {...this.props} /></Draggable>
}
}
// enforceForce=false causes recursion exception otherwise....
dynu.com
dyn.com
no-ip.com
noip.com
changeip.com
afraid.org
duckdns.org
dnsdynamic.org
duiadns.net
myonlineportal.com