References:
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
final Intent intent = new Intent(); | |
ComponentName cName = new ComponentName | |
("package_name","package_name.class_name"); | |
intent.setComponent(cName); | |
startActivity(intent); |
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
#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum)) | |
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type | |
#if (__cplusplus) | |
#define NS_OPTIONS(_type, _name) _type _name; enum : _type | |
#else | |
#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type | |
#endif | |
#else | |
#define NS_ENUM(_type, _name) _type _name; enum | |
#define NS_OPTIONS(_type, _name) _type _name; enum |
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
searchActionItem.setOnActionExpandListener(new | |
OnActionExpandListener() { | |
public boolean onMenuItemActionExpand(MenuItem item) { | |
searchText.post(new Runnable() { | |
public void run() { | |
searchText.requestFocusFromTouch(); | |
InputMethodManager imm = | |
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.showSoftInput(searchText, 0); | |
} |
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
function adbotGetCookie(c_name) { | |
var i,x,y,ARRcookies=document.cookie.split(";"); | |
for (i=0;i<ARRcookies.length;i++) | |
{ | |
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); | |
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); | |
x=x.replace(/^\s+|\s+$/g,""); | |
if (x==c_name){return unescape(y);} | |
} | |
} |
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
COLORS = %w[#AC725E #D0CF64 #F83A22 #FA573C #FF7537 #FFAD46 #42D692 #16A765 #7BD148 #B3DC6C #FBE983 #FAD165 #92E1C0 #9FE1E7 #9FC6E7 #4986E7 #9A9CFF #B99AFF #C2C2C2 #CABDBF #CCA6AC #F691B2 #CD74E6 #A47AE2] |
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
DAYS = %w[0 1 2 3 4 5 6 7] | |
DAYS_HUMAN = %w[Sun Mon Tue Wed Thur Fri Sat] | |
def days=(days) | |
self.days_mask = (days & DAYS).map { |r| 2**DAYS.index(r) }.sum | |
end | |
def days | |
DAYS.reject do |r| | |
((days_mask || 0) & 2**DAYS.index(r)).zero? |
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
def group_sequence(seq) | |
return [] if seq.size == 0 | |
g = Array.new | |
sub = Array.new | |
sub << seq[0] | |
if seq.size > 2 | |
(seq[1..-1]).each do |s| | |
if s -sub[-1] == 1 | |
sub << s |
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
$.group_by_word = (ul_class, sortable, sub_string_count=0)-> | |
$('ul.group').empty() | |
count = 0 | |
word = '' | |
$("ul.#{ul_class} li").each (index, li_el) -> | |
# get attributes |
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
$.sort_then_group_by_character = (sortable, ul_class)-> | |
$.sort_by_words(ul_class, sortable) | |
$('ul.group').empty() | |
count = 0 | |
character = '' | |
$("ul.#{ul_class} li").each (index, li_el) -> |