List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
/* | |
Given an array, rotate the array to the right by k steps, where k is non-negative. | |
Example 1: | |
Input: nums = [1,2,3,4,5,6,7], k = 3 | |
Output: [5,6,7,1,2,3,4] | |
Explanation: | |
rotate 1 steps to the right: [7,1,2,3,4,5,6] | |
rotate 2 steps to the right: [6,7,1,2,3,4,5] |
/* | |
Create a function that will allow you to pass in a string, with the ability to add to this with more function calls. | |
When it is finally passed an empty argument returns the full concatenated string of all arguments passed previously. | |
// For example: mergeWords("Hello")("World!")("how")("are")("you?")(); | |
// This will return the following: "Hello World! how are you?" | |
*/ |
/* | |
Write a program that prints the numbers from 1 to 100. But for multiples | |
of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. | |
For numbers which are multiples of both three and five print “FizzBuzz”. | |
*/ |
SQL BASICS | |
CREATE DATABASE local; | |
-- tell mysql which database to work with | |
USE local; | |
-- create a table with a column | |
create table test ( |
Install kafka/zookeeper and start servers
$ brew install kafka
$ brew install zookeeper
$ zkServer start
$ kafka-server-start /usr/local/etc/kafka/server.properties
Create a topic
#!/bin/bash | |
# Version 0.1 Tuesday, 07 May 2013 | |
# Comments and complaints http://www.nicknorton.net | |
# GUI for mouse wheel speed using imwheel in Gnome | |
# imwheel needs to be installed for this script to work | |
# sudo apt-get install imwheel | |
# Pretty much hard wired to only use a mouse with | |
# left, right and wheel in the middle. | |
# If you have a mouse with complications or special needs, | |
# use the command xev to find what your wheel does. |
# /etc/hosts | |
# BEGIN WORK MACHINE BLOCK | |
0.0.0.0 facebook.com | |
:: facebook.com | |
0.0.0.0 linkedin.com | |
:: linkedin.com | |
0.0.0.0 amazon.in | |
:: amazon.in | |
0.0.0.0 instagram.com |