View BaseActivity.java
@Override
protected void attachBaseContext(Context newBase) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
super.attachBaseContext(wrap(newBase, new LocalState().getLocale().getLanguage()));
} else {
super.attachBaseContext(newBase);
}
}
View actionlist.vim
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
View actionlist.vim
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
View actionlist.vim
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
View pyDes.py
#############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 16th March, 2009
# Verion: 2.0.0
# License: Public Domain - free to do as you wish
# Homepage: http://twhiteman.netfirms.com/des.html
#
View mysql2sqlite.sh
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
View timezoneUtils.py
class TZUtils:
def is_maintainance_time(self):
local_tz = timezone.get_current_timezone()
now = timezone.localtime(timezone.now()).time()
start = timezone.localtime(local_tz.localize(timezone.datetime.strptime('16:00', '%H:%M'))).time()
end = timezone.localtime(local_tz.localize(timezone.datetime.strptime('17:00', '%H:%M'))).time()
logger.info("is_maintainance_time: start - end - now: %s - %s - %s ", start, end, now)
if "BankName" == models.BankTokenization.BANKS_LIST[self.api_req.bank_id]:
return now < start or now > end
return False
View NumberConvertUtils.py
from django.contrib.humanize.templatetags.humanize import intcomma
// use lib
val = _("%s dong") % intcomma(credit_pay_amount)})
val = '{0:,.3f}'.format(float(p['value'])/1000) + _('d')
View UITextFieldMaxLengths.m
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
// Prevent crashing undo bug
if(range.length + range.location > textField.text.length)
{
return NO;
}
NSUInteger newLength = [textField.text length] + [string length] - range.length;
return newLength <= 2;
View BottomDatePicker.m
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
datePicker.backgroundColor = [UIColor whiteColor];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker setMinimumDate:[self.dateFormatter dateFromString:@"1980-01-01"]];
[datePicker setMaximumDate:[self.dateFormatter dateFromString:@"2050-01-01"]];
[datePicker setLocale:[NSLocale localeWithLocaleIdentifier:[CPLanguage sharedInstance].currentLanguageCode]];
self.dateFormatter = [[CPDateFormatter alloc] init];
[self.dateFormatter setDateFormat:@"dd-MM-yyyy"];