Skip to content

Instantly share code, notes, and snippets.

View codergautam's full-sized avatar

Coder Gautam codergautam

View GitHub Profile
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@ashblue
ashblue / move-point-at-angle.js
Created October 9, 2012 17:12
Move point at an angle
/**
* Moves a vertex at an angle for a specific distance, 0 degrees points up and 180 degrees points down
* @param {array} point Location on a cartesian graph formatted as [x, y]
* @param {number} angle Angle at which a point should move in radians
* @param {number} distance How far should the point move at the given angle in pixels?
* @returns {array} Newly moved point formatted as [x, y]
*/
function movePointAtAngle (point, angle, distance) {
return [
point[0] + (Math.sin(angle) * distance),
function getRandomInt(min, max) {
return min + Math.floor(Math.random() * (max - min + 1));
}
@nvictus
nvictus / loadnpy.js
Last active July 4, 2024 09:10
NumPy binary file parser for javascript
// Client-side parser for .npy files
// See the specification: http://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
var NumpyLoader = (function () {
function asciiDecode(buf) {
return String.fromCharCode.apply(null, new Uint8Array(buf));
}
function readUint16LE(buffer) {
var view = new DataView(buffer);
var val = view.getUint8(0);
@ericelliott
ericelliott / .gitignore
Created November 15, 2016 19:51
Sample Node project .gitignore
node_modules
build
npm-debug.log
.env
.DS_Store
@wanglf
wanglf / vscode-extension-offline.md
Last active July 16, 2024 07:34
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
// Linear interpolation
const lerp = function(start, end, t){
return start * (1 - t) + end * t;
}
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 22, 2024 05:09
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

//Y value is quadratic checker
//Checks if given y values are quadratic
//Y values
var numbers = []
var arr2 = []
var arr3 = []
numbers.forEach((number, i) => {
@codergautam
codergautam / typeracerhack.js
Last active May 5, 2021 12:41
very buggy made in 5 min typeracer.com hack
//copy below code and paste in developer console
//known bugs
//you need to keep focus and unfocusing the text box for the words to register and move forwars
//it will glitch and slow down on commas, but it will move on eventually
//at the end, it will start doing character by character
//how to change speed:
//go to the last line where you see }, 500)
//make the lower for higher speed, make it higher for lower speed
function getWord() {