- Re-Order Lauchpad APPS
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
| //Fastest way to copy a Collection in MongoDB | |
| db.getCollection('OriginalCollection').aggregate([ { $out: "ClonedCollection" } ]); |
| // JavaScript (ES6) port of the code at https://gist.github.com/bhelx/778542 | |
| // Also handles leading 0's in strings | |
| const BASE = 62; | |
| const UPPERCASE_OFFSET = 55; | |
| const LOWERCASE_OFFSET = 61; | |
| const DIGIT_OFFSET = 48; | |
| class Base62{ | |
| constructor() { |
| String.prototype.strstr = function(needle) { | |
| const haystack = this; | |
| if(!needle) return [0]; | |
| if(!haystack || needle.length > haystack.length) return [-1]; | |
| let i,j; | |
| let positions = []; | |
| for(i=0;i<haystack.length;i++) { | |
| let index = i; | |
| j=0; |
| class Node { | |
| constructor(data) { | |
| this.data = data; | |
| this.left = null; | |
| this.right = null; | |
| this.inorderOut = []; | |
| this.preorderOut = []; | |
| this.postorderOut = []; | |
| } | |
| insert(data) { |
| class Node { | |
| constructor(data) { | |
| this.data = data; | |
| this.count = 1; | |
| this.left = null; | |
| this.right = null; | |
| this.inorderOut = []; | |
| this.preorderOut = []; | |
| this.postorderOut = []; | |
| } |
| sudo dd bs=4M if=~/Downloads/Fedora-KDE-Live-x86_64-28-1.1.iso of=/dev/sdb status=progress conv=fdatasync | |
| #Get Usb drive name by issuing the following command | |
| #fdisk -l | |
| #http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html |
| Open a terminal and run the following commands (cd to your home directory first) | |
| sudo apt install xbacklight | |
| xauth generate :0 . trusted | |
| xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom) | |
| sudo vi /etc/udev/rules.d/98-backlight.rules | |
| Paste the following into the 98-backlight.rules | |
| ################################################# START ################################### | |
| # Adjust screen brightness according to power state | |
| # 1st rule for when on AC | |
| ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", RUN+="/usr/bin/xbacklight -set 85" |
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
| Apache License | |
| Version 2.0, January 2004 | |
| http://www.apache.org/licenses/ | |
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
| 1. Definitions. | |
| "License" shall mean the terms and conditions for use, reproduction, | |
| and distribution as defined by Sections 1 through 9 of this document. |
| package main | |
| import "fmt" | |
| func fnvHash32(key string) uint32 { | |
| hash := uint32(2156825496) | |
| const prime32 = uint32(16777619) | |
| for i := 0; i < len(key); i++ { | |
| hash *= prime32 | |
| hash ^= uint32(key[i]) |