Shut down without showing a confirmation dialog:
osascript -e 'tell app "System Events" to shut down'
Shut down after showing a confirmation dialog:
osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
Add config.ssh.insert_key = false in VagrantFile |
No supported encrypter found. The cipher and / or key length are invalid. | |
This Error means that App key hasn't been added or it is invalid. To fix it... | |
php artisan key:generate | |
Above commad generates a new key. Confirm in .env file that APP_KEY is updated with new key, if not paste the new key here. |
Get hash of last commit (eg. 1fa01e4b90a09069a5aa6482a71c5f76118eef9e) | |
git rev-parse HEAD | |
Get short hash of last commit (eg. 1fa01e4) | |
git rev-parse --short HEAD |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
import subprocess | |
import sys | |
if len(sys.argv) == 1 : | |
print "missing program name to quit" | |
else: | |
program=sys.argv[1] | |
quitCommand='tell application "' + program + '" to quit' | |
print "quiting " + program | |
subprocess.call(['osascript', '-e', quitCommand]) |
Shut down without showing a confirmation dialog:
osascript -e 'tell app "System Events" to shut down'
Shut down after showing a confirmation dialog:
osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
# -*- coding: utf-8 -*- | |
import subprocess | |
subprocess.call(['osascript', '-e', 'tell app "loginwindow" to «event aevtrsdn»']) | |
#usage: > python mac_shutdown.py | |
# For further similar system commands: https://gist.github.com/atifazad/6afd3cbedb8819dd7ed7be92dec2dc0d |
#import <Foundation/Foundation.h> | |
@interface Solution : NSObject | |
- (NSString *)countAndCall: (int) n; | |
- (NSString *)count:(int) n; | |
@end | |
@implementation Solution | |
- (NSString *)countAndCall: (int) n { |
This gist contains Hello World examples for several programming languages and framworks. This codes from this gist are being used (as embed code) at Hello World page at my weebsite (https://atifazad.com/tutorials/general/hello-world/) |
Python basics step by step examples |