View slick.js.jsx
/** | |
* 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 |
View microsoft_excel_is_a_pile_of_shit_and_bill_gates_knows_it_da_doy.rb
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/ |
View got.rb
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? |
View google-login-example.js
// 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() { |
View vimrc
" | |
" 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!.. |
View Preferences.sublime-settings
{ | |
"added_words": | |
[ | |
"pio", | |
"namespace", | |
"indices", | |
"clientside" | |
], | |
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
"detect_indentation": false, |
View pseudo_sensors_osx.sh
# 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' |
View randomize_activities
# Randomize the activity dates for testing purposes. | |
PublicActivity::Activity.all.each { |it| it.update(created_at: Faker::Date.between(1.year.ago, Date.today)) } |