Skip to content

Instantly share code, notes, and snippets.

Damien Sutevski dam13n

Block or report user

Report or block dam13n

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1178b5ddd31fd364002003bcb17f4105
abandon
ability
able
about
above
absent
absorb
abstract
absurd
abuse
@dam13n
dam13n / bip39_close_pairs_list.txt
Last active Sep 11, 2017
bip39 close pairs list
View bip39_close_pairs_list.txt
able, cable
able, table
across, cross
act, pact
again, gain
age, cage
age, page
age, wage
agree, green
ahead, head
View bubblewrap_kvo_fix.rb
# hotfix for ios 9.3.1 KVO issue (perhaps specifically for observering NSDefaults)
# reference
# http://stackoverflow.com/questions/36193503/kvo-broken-in-ios-9-3
module BubbleWrap
module KVO
class Registry
attr_accessor :observer_last_called_at
def observeValueForKeyPath(key_path, ofObject: target, change: change, context: context)
key_paths = callbacks[target] || {}
View conditional
if ([[_imageArray objectAtIndex:indexPath.row] isKindOfClass:[UIImage class]]) {
cell.imgView.image = [_imageArray objectAtIndex:indexPath.row];
} else if ([[_imageArray objectAtIndex:indexPath.row] isKindOfClass:[NSString class]]) {
cell.imgView.image = [UIImage imageNamed:[_imageArray objectAtIndex:indexPath.row]];
}
View gist:1488119b23b6e53159b3
var _ctq = _ctq || [];
// Create 'compare to' strip object
_ctq.push(['newCompareToStrip', 'a']);
_ctq.push(['a.setPublisherID', 4]);
_ctq.push(['a.setAnchorID', 'ctAnchor']);
_ctq.push(['a.setFormID', 'ctSearchForm']);
View gist:70f80b95bcb4de8182ac
rooms = (hashtags+keywords).uniq & trend_array #.map!{|c| c.downcase.delete('#')}
# puts "rooms are #{rooms}"
rooms.each do |r|
# puts "now is #{Time.now}"
# puts "#{r}"
# puts "#{REDIS.get(r)}"
# puts "#{r} time is #{Time.parse(REDIS.get(r))}"
last_time = REDIS.get(r)
if last_time
View gist:ecaced79230d3aeba57f
<meta name="twitter:card" content="app">
<meta name="twitter:site" content="@poundcakeapp">
<meta name="twitter:description" content="Create your own rooms and chat on any topic. For Android and iOS.">
<!-- <meta name="twitter:app:country" content="US"> -->
<meta name="twitter:app:name:iphone" content="Poundcake">
<meta name="twitter:app:id:iphone" content="942027968">
<meta name="twitter:app:url:iphone" content="Poundcake://">
<!-- <meta name="twitter:app:name:ipad" content="Cannonball">
<meta name="twitter:app:id:ipad" content="929750075"> -->
<!-- <meta name="twitter:app:url:ipad" content="cannonball://poem/5149e249222f9e600a7540ef"> -->
View gist:f5d326443f5b57c07c90
terms_label = TTTAttributedLabel.alloc.initWithFrame(CGRectZero)
# terms_label.enabledTextCheckingTypes = NSTextCheckingTypeLink
terms_label.delegate = self
terms_label.lineBreakMode = UILineBreakModeWordWrap;
terms_label.numberOfLines = 0;
paragraph = NSMutableAttributedString.alloc.initWithString("blah blah blah Terms blah blah")
terms_label.setText(paragraph)
range = [terms_label.text.index("Terms"), 5]
# range = terms_label.text rangeOfString:@"me"];
View gist:e6f2461ac79ee2b26375
class HomeController < UIViewController
include BW::KVO
def viewWillAppear(animated)
super
end
def viewDidLoad
super
View gist:b6d0891ff52e2039ff5d
messagesRef = Firebase(url: "https://swift-chat.firebaseio.com/messages")
// *** STEP 4: RECEIVE MESSAGES FROM FIREBASE
messagesRef.observeEventType(FEventType.ChildAdded, withBlock: { (snapshot) in
let text = snapshot.value["text"] as? String
let sender = snapshot.value["sender"] as? String
let imageUrl = snapshot.value["imageUrl"] as? String
let message = Message(text: text, sender: sender, imageUrl: imageUrl)
self.messages.append(message)
You can’t perform that action at this time.