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
/** | |
* Slick UX for displaying text while allowing focus input. | |
*/ | |
const React = require('react'); | |
const classNames = require('classnames'); | |
module.exports = React.createClass({ | |
getInitialState() { | |
return { | |
'toggled': false |
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
POOR_MANS_LINE_BREAK = '__br__' | |
# How to insert newlines into strings when working with excel in ruby. | |
# | |
# NOTE: There are probably better ways of doing this, but this works for me. -uly, oct 2017 | |
# | |
# See https://stackoverflow.com/questions/14856501/substitute-a-comma-with-a-break-link-in-a-cell | |
# GOTCHA: Careful to guard against blank strings; breaks excel and will result in a "repair". | |
def insert_newlines_into_excel_value_if_any(s) | |
s = "=SUBSTITUTE(\"#{ s.gsub(/\n/, POOR_MANS_LINE_BREAK) }\", \"#{ POOR_MANS_LINE_BREAK }\", CHAR(13))" if s =~ /\n/ |
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
module MyModuleName | |
# Safely navigate a hashmap via dot-notation, similar to lodash#get. | |
# May return nil; Assumes string keys, will not work for symbols! | |
# | |
# Example Usage: | |
# got(foo, 'bar.fizz.buzz') | |
def got(object, dot_notation_path, default_value = nil) | |
# FIXME: Does not support OpenStruct! -uly, july 2016 | |
keys = dot_notation_path.split('.') | |
while !keys.empty? && !object.nil? |
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
// Also see http://stackoverflow.com/questions/35822029/casperjs-google-login-not-working | |
const env = require('system').env; | |
const google_email = env.MY_GOOGLE_EMAIL; | |
const google_passwd = env.MY_GOOGLE_PASSWD; | |
var casper = require('casper').create(); | |
casper.start('https://accounts.google.com/ServiceLogin?hl=EN', function() { | |
casper.waitForSelector('form#gaia_loginform #Email', 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
" | |
" Uly's .vimrc | |
" | |
" references: | |
" http://tottinge.blogsome.com/use-vim-like-a-pro | |
" https://raw.github.com/nvie/vimrc/master/vimrc | |
" http://spf13.com/post/the-15-best-vim-plugins | |
" | |
set nocompatible "..set not compatible first!.. |
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
Show hidden characters
{ | |
"added_words": | |
[ | |
"pio", | |
"namespace", | |
"indices", | |
"clientside" | |
], | |
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
"detect_indentation": false, |
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
# After installing the "iStats" gem; | |
# Add the following line to ~/.bashrc | |
# see http://apple.stackexchange.com/a/127453/145556 | |
alias sensors='istats | grep -v "Unknown temp" | grep -v "??" | grep -v "\-127" | tail -r' |
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
# Randomize the activity dates for testing purposes. | |
PublicActivity::Activity.all.each { |it| it.update(created_at: Faker::Date.between(1.year.ago, Date.today)) } |