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
| ftp = Net::FTP.new(server, username, password) | |
| ftp.passive = true | |
| ftp.chdir('some dir') | |
| uploaded_file = params[:file][:file] | |
| ftp.putbinaryfile(uploaded_file.tempfile) | |
| ftp.rename(File.basename(uploaded_file.tempfile.to_path), uploaded_file.original_filename) |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>JIRA ticket template</title> | |
| <style type="text/css"> | |
| div, p, h1 { | |
| margin:0; padding:0; | |
| } | |
| body { |
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
| // Copied from http://stackoverflow.com/questions/2215672/how-to-change-the-push-and-pop-animations-in-a-navigation-based-app | |
| For Push: | |
| MainView *nextView=[[MainView alloc] init]; | |
| [UIView beginAnimations:nil context:NULL]; | |
| [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; | |
| [UIView setAnimationDuration:0.75]; | |
| [self.navigationController pushViewController:nextView animated:NO]; | |
| [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO]; |
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
| gradient_background(start_color, stop_color) | |
| background linear-gradient(top, start_color, stop_color); /* Standard (W3C) */ | |
| background -moz-linear-gradient(center top, start_color, stop_color); /* FF */ | |
| background -webkit-gradient(linear, left top, left bottom, from(start_color), to(stop_color)); /* Chrome, Safari */ | |
| background -o-linear-gradient(top, start_color, stop_color); /* Opera */ | |
| body | |
| background url(/images/darkdenim3.png) repeat | |
| font-family Arial | |
| font-size 12px |
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
| background-image: -webkit-gradient(radial, 50% 50%, 1, 50% 50%, 283, color-stop(0, rgba(112, 66, 20, 0.2)), color-stop(1, rgba(112, 66, 20, 0.4))); | |
| background-image: -webkit-radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
| background-image: -moz-radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
| background-image: radial-gradient(rgba(112, 66, 20, 0.2), rgba(112, 66, 20, 0.4)); | |
| -webkit-box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); | |
| -moz-box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); | |
| box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5); |
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
| // http://pastebin.com/raw.php?i=Xdf49BgK | |
| @interface UIBarButtonItem (UIBarButtonItem_customBackground) | |
| + (id) customBarButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector; | |
| + (id) customBackButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector; | |
| @end | |
| @implementation UIBarButtonItem (UIBarButtonItem_customBackground) |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
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
| stat -c %a /etc/passwd |
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 myFunction (a, blabla, c, somethingElse, e, f) { | |
| var obj = []; | |
| //'(a, b, c, d, e, f)' | |
| var tmp = arguments.callee.toString().match(/\(.*?\)/g)[0]; | |
| //["a", "b", "c", "d", "e", "f"] | |
| var argumentNames = tmp.replace(/[()\s]/g,'').split(','); | |
| [].splice.call(arguments,0).forEach(function(arg,i) { | |
| obj.push({ | |
| // question is how to get variable name here? |