npm v3.10 - ◾
npm install -g npm
# Downgrade to a specific version
npm install -g npm@6
npm install -g npm
# Downgrade to a specific version
npm install -g npm@6
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
| Read 4K randomly from SSD* 150,000 ns 0.15 ms |
| # aecho.py | |
| from socket import * | |
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def echo_server(address): | |
| sock = socket(AF_INET, SOCK_STREAM) | |
| sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) |
| # install dependencies | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential | |
| sudo apt-get install -y cmake | |
| sudo apt-get install -y libgtk2.0-dev | |
| sudo apt-get install -y pkg-config | |
| sudo apt-get install -y python-numpy python-dev | |
| sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
| sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |
A Pen by Cesar Augusto Nogueira on CodePen.
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
| def yes_or_no(question): | |
| reply = str(raw_input(question+' (y/n): ')).lower().strip() | |
| if reply[0] == 'y': | |
| return True | |
| if reply[0] == 'n': | |
| return False | |
| else: | |
| return yes_or_no("Uhhhh... please enter ") |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
Object Calisthenics outlines 9 basic rules to apply when performing the exercise:
| import org.junit.Test; | |
| public class BetterProgrammer05122012Test extends junit.framework.TestCase { | |
| public static int[] numbers = new int[] {5, 10, -5, 0, 25, 35}; | |
| public static int[] numbers2 = new int[] {5, 10, -5, -2, 0, 25, 35}; | |
| public static int[] noNegativeNumbers = new int[] {5, 10, 15, 25, 35}; | |
| @Test | |
| public void testBetterProgrammer05122012 () { |