This cheatsheet is to assist anyone new with Git with becoming familiar with common scenarious.
git checkout HEAD -- my-file.txt
| # GNU Screen | |
| # Preferred Configuration File | |
| # Turn off start up message | |
| startup_message "off" | |
| # Allow bold colors | |
| attrcolor b ".I" | |
| # Tell screen how to set colors. AB = background, AF=foreground |
| NSFileManager *fileManager = [NSFileManager defaultManager]; | |
| NSURL *bundleURL = [[NSBundle mainBundle] bundleURL]; | |
| NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:bundleURL | |
| includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey] | |
| options:NSDirectoryEnumerationSkipsHiddenFiles | |
| errorHandler:^BOOL(NSURL *url, NSError *error) | |
| { | |
| NSLog(@"[Error] %@ (%@)", error, url); | |
| }]; |
| using System.Net.Http; | |
| using (var client = new HttpClient()) | |
| { | |
| var url = "http://google.com/api-example"; | |
| var response = client.GetAsync(url).Result; | |
| if (response.IsSuccessStatusCode) | |
| { | |
| // by calling .Result you are performing a synchronous call |
| using (var client = new HttpClient()) | |
| { | |
| var request = new HttpRequestMessage() | |
| { | |
| RequestUri = new Uri("http://google.com/"), | |
| Method = HttpMethod.Get | |
| }; | |
| request.Headers.Add("Content-Type", "application/json; charset=utf-8"); | |
| var response = client.SendAsync(request).Result; |
| description "Tomcat Server" | |
| start on runlevel [2345] | |
| stop on runlevel [!2345] | |
| respawn | |
| respawn limit 10 5 | |
| setuid tomcat | |
| setgid tomcat |
add-apt-repository ppa:webupd8team/java
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository 'deb http://ftp.utexas.edu/mariadb/repo/10.1/ubuntu trusty main'
apt-get update; apt-get upgrade
apt-get install screen whois git npm nodejs-legacy nodejs oracle-java8-installer software-properties-common mariadb-server
groupadd tomcat
useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
| public class AppPath { | |
| public String getAppPath() { | |
| URL url; | |
| String extURL; | |
| Class anyClass = this.getClass(); | |
| try { | |
| url = anyClass.getProtectionDomain().getCodeSource().getLocation(); |
| for k in `ls`; do echo "Getting latest for $k"; cd $k; git fetch; git pull; cd ..; done |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); |