Skip to content

Instantly share code, notes, and snippets.

const color = require('ansi-color').set
exports.make = function(str) {
return intToRGB(hashCode(str))
}
exports.paint = function(text, hex) {
let R, G, B;
let { r, g, b } = splitHexToRGB(hex)
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'rust-lang/rust.vim'
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@ikouchiha47
ikouchiha47 / interviewitems.MD
Created July 19, 2016 05:43 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@ikouchiha47
ikouchiha47 / parenthesis.js
Last active August 10, 2016 06:40
check string has balenced parenthesis
var stack = [];
var Check = {
isOpen: (str) => ['{', '(', ']'].includes(str),
isClosed: (str) => ['}', ')', ']'].includes(str),
checkClosed: (i, j) => (i == '(' && j == ')') || (i == '{' && j == '}') || (i == '[' && j == ']'),
test: function(str) {
import requests
from bs4 import BeautifulSoup
url = 'http://webmusic.in/bengali_music.php?id=1066'
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, 'lxml')
songs = soup.find(id='lFs').find_all('a')
const fullDates = ["Monday", "Tuesday", "Wednesday", "Thrusday", "Friday", "Saturday", "Sunday"];
const shortDates = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const fullMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const re = /(MM?M?M?|ddd?d?|YYYY|YY|HH?|hh?|mm?|tt|.)/g;
function contains(array, props) {
if(!props.splice) props = [props];
var $ = window.$ = function (sel, ctx) {
return document.querySelector(sel);
}
$.set = function(el, opts) {
if(opts.text) el.appendChild(document.createTextNode(opts.text)) ;
if(opts.classList) opts.classList.forEach(c => el.classList.add(c))
if(opts.style) Object.keys(opts.style).forEach(k => el.style[k] = opts.style[k]);
if(opts.children) opts.children.forEach(ch => el.appendChild(ch));
if(opts.attrs) Object.keys(opts.attrs).forEach(k => el.setAttribute(k, opts.attrs[k]))
const fullDates = ["Monday", "Tuesday", "Wednesday", "Thrusday", "Friday", "Saturday", "Sunday"];
const shortDates = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const fullMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const re = /(MM?M?M?|ddd?d?|YYYY|YY|HH?|hh?|mm?|tt|.)/g;
function contains(array, props) {
if(!props.splice) props = [props];
"use strict";
import Fluxible from 'fluxible';
import {createStore} from 'fluxible/addons';
const tickAction = (actionCtx, payload) => {
actionCtx.dispatch('COUNT_ACTION', payload)
};
const TickStore = createStore({
storeName: 'TickStore',