This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
described_class.name.underscore.split('_').reverse.drop(1).reverse.join('_').to_sym |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query: function (str, opts) { | |
var def = new Deferred(); | |
request.get(this.target, { query: opts }).then(function (res) { | |
def.resolve(res.vals); | |
}, def.reject); | |
return QueryResults(def); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.ArrayController.extend({ | |
/** | |
* @return {Ember.ArrayProxy} | |
*/ | |
completeTasks: Ember.computed.filterBy("model", "isComplete"), | |
/** | |
* @return {Ember.ArrayProxy} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk | |
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane | |
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin | |
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist | |
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper | |
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.JavaUpdateHelper.plist | |
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Checkout extends Component { | |
constructor(props) { | |
super(props); | |
this.subscriptions = []; | |
} | |
componentDidMount() { | |
const { cardReader: { emitter } } = global; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@objc(CardReaderManager) | |
class CardReaderManager: RCTEventEmitter { | |
func cardDataReceived(data: Dictionary<String, String>, sender: AnyObject) { | |
StripeUtil.createToken(data) { (token, error) in | |
self.sendEvent( | |
withName: "stripeToken", | |
body: token | |
) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Component.extend({ | |
didInsertElement() { | |
document.addEventListener('message', this._handleMessage.bind(this)); | |
}, | |
willDestroyElement() { | |
document.removeEventListener('message', this._handleMessage.bind(this)); | |
} | |
_handleMessage(message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
rule 90 implementation | |
""" | |
def rule90(starting): | |
grid, m = [starting], len(starting) | |
for i in range(1, m): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://en.wikipedia.org/wiki/Merge-insertion_sort | |
""" | |
from typing import List, Callable, Tuple | |
from bisect import bisect | |
# max of pair, min of pair | |
Pair = Tuple[int, int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jdb.db import DB | |
db = DB() | |
with db.transaction() as txn: | |
txn.read(b'foo') | |
txn.write(b'bar', b'baz') |
OlderNewer