Skip to content

Instantly share code, notes, and snippets.

@Thiruppathi
Thiruppathi / data-structure.js
Last active August 29, 2015 14:27 — forked from sararob/data-structure.js
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@Thiruppathi
Thiruppathi / .bash_profile
Last active July 24, 2018 17:56
.bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$PATH:/Users/thiru/npm/bin
export PATH=$PATH:/Users/thiru/apps/mongodb/bin
export PATH="$PATH:$HOME/.yarn/bin"
export GOPATH=$HOME/go
export PATH=/Users/thiru/apps/phantomjs-2.1.1-macosx/bin:$PATH
export NVM_DIR="/Users/thiru/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

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

We couldn’t find that file to show.

Download videos from egghead

Go to the egghead course URL.

e.g. https://egghead.io/courses/asynchronous-javascript-with-async-await Click Play Course

run the following script in browser console.

$.each($('.up-next-list-item'), function(index, a){

Novel - By Jeyamohan

தமிழில் வெளிவந்துள்ள பெரும்பாலான நாவல்களை நீண்டகதைகள் என்றே சொல்லமுடியும் என்றும் நாவல் என்ற கலை வடிவத்துக்கு உலகளாவிய தளத்தில் உள்ள சாத்தியங்களை தமிழ் எழுத்தாளர்கள் எதிர்கொள்ளவில்லை என்றும் பேசினேன்.

சிறுகதைகள் எழுதுவதைப்போல கொஞ்சம் நீட்டினால் நாவல் என்ற எண்ணம் அன்று இருந்தது. சிறுகதைகளுக்கு உரிய சொற்செட்டு, சுருக்கிக் கூறும் போக்கு, குறிப்புணர்த்தும் தன்மை ஆகியவையே நாவலிலும் கையாளப்பட்டன. ஆகவே நாவலுக்கு உரிய விரிந்து பரவும் தன்மைக்குப் பதிலாக குறுகி ஒடுங்கும் தன்மையே அக்கால நாவல்களுக்கு இருந்தது.

அது நவீனத்துவ அழகியலுக்கு உரிய மனநிலையும்கூட. சமூகத்தை, வரலாற்றை, இயற்கையை கணக்கில் கொள்ளாமல் நாவலாசிரியன் தன்னில் ஆரம்பித்து தன்னிலேயே நாவலை முடிக்கும் போக்கு கொண்டிருந்ததன் விளைவு அது. தமிழ் நாவல்களில் ஏன் தமிழகத்தின் பாரம்பரியமோ, இயற்கையோ இல்லை என்று நான் இந்த நூலில் கேட்கும் கேள்விக்குக் காரணம் அதுதான்.

/*
[![Lighthouse score: 93/100](https://lighthouse-badge.appspot.com/?score=93&compact&category=Performance)](https://github.com/ebidel/lighthouse-badge)
[![Lighthouse score: 100/100](https://lighthouse-badge.appspot.com/?score=100&compact&category=A11y)](https://github.com/ebidel/lighthouse-badge)
[![Lighthouse score: 94/100](https://lighthouse-badge.appspot.com/?score=94&compact&category=BestPractices)](https://github.com/ebidel/lighthouse-badge)
[![Lighthouse score: 89/100](https://lighthouse-badge.appspot.com/?score=89&compact&category=SEO)](https://github.com/ebidel/lighthouse-badge)
[![Lighthouse score: 73/100](https://lighthouse-badge.appspot.com/?score=73&compact&category=PWA)](https://github.com/ebidel/lighthouse-badge)
*/
// let compactTemplate = `[![Lighthouse score: ${score}/100](https://lighthouse-badge.appspot.com/?score=${score}&${size}&category=${category})]`;
let myScores = {
/* Missing Integer - Codility
This is a demo task.
Write a function:
function solution(A);
that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
// Custom code to rename files.
/* 1. Create Lesson.json
{ "01-01" : "01. Title" }
*/
/* 2. Make sure the file names are in "01-01.mp4" format*/
const fs = require('fs');
fs.readFile('lesson.json', function(error, data) {
function a11yMyName(str) {
return str[0] + str.slice(1, str.length-1).length + str[str.length-1] || '';
}
a11yMyName('internationalisation'); // i18n
a11yMyName('accessibility'); // a11y