This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../paper-icon-button/paper-icon-button.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-icon-button/paper-icon-button.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/iconsets/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Color Scheme switch for linux | |
fu! ToggleLinuxColors() | |
if exists('base16colorspace') && base16colorspace == "256" | |
let s:base16colorspace = "mac" | |
else | |
let s:base16colorspace = 256 | |
endif | |
exec "colorscheme base16-default" | |
endfu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: time ruby cross_join.rb group_1.txt group_2.txt | |
a1d826a157c20ed6cb3d20292d5bc5b4, a1d826a157c20ed6cb3d20292d5bc5b4 | |
real 6948m15.378s | |
user 6849m3.990s | |
sys 80m35.040s | |
$: time ruby hash_join.rb group_1.txt group_2.txt 100 | |
a1d826a157c20ed6cb3d20292d5bc5b4, a1d826a157c20ed6cb3d20292d5bc5b4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/Black Tree implementation in GO | |
1- Write the tree.Add(int) function | |
2- Write a red black tree validator | |
- check if root is black | |
- check if the number of black nodes from the root to every nil is the same | |
- check that there are no two consecutive red nodes | |
3- Write the tree.Contains(int) function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helps you migrate from attachment_fu | |
# put it in your /lib dir and include it your xxxx_uploader.rb | |
module UploaderFu | |
def partition_dir | |
("%08d" % model.id).scan(/\d{4}/).join("/") | |
end | |
def model_dir | |
"#{model.class.to_s.underscore}/#{mounted_as}/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::list<int> list; | |
std::list<int>::iterator pos; | |
pos = list.begin(); | |
list.insert(it, 1024); | |
pos = std::find(list.begin(), list.end(), 1024); | |
*pos; // get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## SOLUTION | |
def binary(value, data, low, high) | |
center = low + (high - low) / 2 # C | |
if center < low # C | |
nil # C | |
elsif data[center] == value # C | |
center # C | |
elsif data[center] > value # C | |
binary(value, data, low, center - 1) # T(n/2) + C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li> | |
User Locale: {{ fb.user.locale }} | |
</li> | |
<li> | |
User Country: {{ fb.user.country }} | |
</li> | |
<li> | |
Min Age: {{ fb.user.age.min }} | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='http://fronts.dev/assets/javascripts/widget/bail-calc.js' type='text/javascript'></script> <div id='bail-widget-container' data-attr='[{"maxValue":"1000","percentage":"10"},{"maxValue":"15000","percentage":"15"}]' data-phone='123-456-7890'> Bail Bonds calculator by <a id='ab_link' href='http://www.aboutbail.com/'>AboutBail</a>. </div> |
NewerOlder