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 UsersController < ActionController::Base | |
def update | |
@user = current_user | |
if @user.update_attributes(user_profile_parameters) | |
redirect_to home_path, notice: "Your profile has been successfully updated." | |
else | |
render action: "edit" | |
end | |
end |
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
curl ifconfig.me |
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
in Info.plist | |
<key>CFBundleLocalizations</key> | |
<array> | |
<string>zh_CN</string> | |
<string>en</string> | |
<string>de</string> | |
</array> |
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
[op setDownloadProgressBlock:^(NSInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { | |
if (totalBytesExpectedToRead > 0) { | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
self.progressView.alpha = 1; | |
self.progressView.progress = (float)totalBytesRead / (float)totalBytesExpectedToRead; | |
NSString *label = [NSString stringWithFormat:@"Downloaded %lld of %lld bytes", | |
totalBytesRead, | |
totalBytesExpectedToRead]; | |
self.progressLabel.text = label; | |
}); |
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
in .h | |
extern NSString *const name; | |
in .m | |
NSString *const name = @"Helle World"; |
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
public void exportToExcel(Window mainWindow){ | |
//String title; | |
// String[] Headers TableColumnsDef. , Data, outputStream | |
HSSFWorkbook workbook = new HSSFWorkbook(); | |
HSSFSheet sheet = workbook.createSheet("Export"); | |
// Header Style | |
HSSFCellStyle style = workbook.createCellStyle(); | |
style.setFillForegroundColor(HSSFColor.SKY_BLUE.index); | |
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); |
NewerOlder