Skip to content

Instantly share code, notes, and snippets.

View randallb's full-sized avatar
🎬

Randall Bennett randallb

🎬
View GitHub Profile
{"author_handle":"maryju333","author_image":"http://si0.twimg.com/profile_images/3611908649/888dc6ffc60510e36b758e0ff688cdea.jpeg","author_name":"MARIA JULIA ","author_service_id":209315366,"channel_id":null,"created_at":null,"id":null,"image":null,"likes":null,"message":"@Frec_Latina #ALAIRE #90FL El sistema d Albergues NO funciona hay abuso entre ninhos abandonados Kerk estara Protegido con Tios o parientes","org_id":null,"playlist_id":null,"position":null,"post_id":null,"posted_at":"2013-09-17T13:32:19-06:00","retweets":0,"service_data":{"metadata":{"result_type":"recent","iso_language_code":"es"},"created_at":"Tue Sep 17 19:32:19 +0000 2013","id":380051608672808960,"id_str":"380051608672808960","text":"@Frec_Latina #ALAIRE #90FL El sistema d Albergues NO funciona hay abuso entre ninhos abandonados Kerk estara Protegido con Tios o parientes","source":"<a href=\"http://blackberry.com/twitter\" rel=\"nofollow\">Twitter for BlackBerry\u00ae</a>","truncated":false,"in_reply_to_status_id":380014331938619392,"in
<script>
jQuery().ready(function{
width = jQuery(window).width()
if(width > 768){
jQuery(".big-ad").show();
// init code for the big ad
}else{
jQuery(".small-ad").show()
// init code for the small ad
}
@randallb
randallb / gist:8154300
Created December 28, 2013 00:02
Emmett originally wrote this post but I couldn't find anywhere except on archive.org. So I mirrored.

As I've done more code reviews at Justin.tv, I've started to notice a pattern. When I get a diff and I have trouble keeping focused because it's just that boring, this is a sign that the code is pretty much ready to go into production. This isn't to say that the code should be repetitive; repetitive code is not boring. I imagine it might be boring if I read it, but the instant I see the same pattern more than once in the code I just make a note to refactor it and move on. So a really repetitive code review actually is one of the more interesting ones to read - if you don't find noticing repeated patterns in code fun you're probably not a programmer. A really boring code review has very little obvious repetition.

Another thing that often makes a code review interesting is implementing a new generic abstraction. Personally, I love generic abstractions. New kinds of iterators are a particular favorite of mine, because they allow you to so cleanly separate what you do to each item from how you find each one.

$("element").on "click, ->
alert this.name
_.each arrayThingy, (arr) ->
alert arr
$().ready ->
$('h1').click ->
alert("You clicked this")
i686-apple-darwin11-gcc-4.2.1: /Users/randall/Library/Developer/Xcode/DerivedData/BrowserToBlackmagic-bdqukgmikzoifkadapwoehvipiqn/Build/Intermediates/PrecompiledHeaders/BrowserToBlackmagic-Prefix-bdakshkejogectabyciwlzivrtjs/BrowserToBlackmagic-Prefix.pch.dia: No such file or directory
cc1objplus: error: unrecognized command line option "-Wno-implicit-atomic-properties"
cc1objplus: error: -Werror=deprecated-objc-isa-usage: No option -Wdeprecated-objc-isa-usage
cc1objplus: error: -Werror=objc-root-class: No option -Wobjc-root-class
cc1objplus: error: unrecognized command line option "-Wno-receiver-is-weak"
cc1objplus: error: unrecognized command line option "-Wno-arc-repeated-use-of-weak"
cc1objplus: error: unrecognized command line option "-Wno-exit-time-destructors"
cc1objplus: error: unrecognized command line option "-Wduplicate-method-match"
cc1objplus: error: unrecognized command line option "-Wconstant-conversion"
cc1objplus: error: unrecognized command line option "-Wint-conversion"
#!/usr/bin/env bash
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
sudo apt-get install -y git
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 3 column 22
---
layout: post
published: false
title: Don't buy fans: How broadcasters can get the most out of Facebook, without having to pay to promote posts
---
<iframe width="560" height="315" src="//www.youtube.com/embed/oVfHeWTKjag?rel=0" frameborder="0" allowfullscreen></iframe>

You might have seen a video explaining how buying likes from Facebook can actually hurt your ability to reach your audience. It's true: Click farmers spend hours trying to like pages for which they'll never engage. And, savvy social media analysts note the less people engage with your posts, the lower in priority Facebook will rank your posts, and fewer people will see them broadly. Then, if you want anyone to see your posts, you wind up paying Facebook to promote posts to people who've already asked to see your content. Not a fun situation.

@pauliooj on rails:

"It's sort of like this... Imagine you want to travel to Mars. First you ask a C-style programming environment, and get the answer: "Sure you can. You should compute an optimal trajectory. And get enough liquid oxygen to use as fuel, obviously. And build a launching pad... Preferably near the equator. And a few other things." Then you ask a Rails-style environment. The answer is: "Mars? Yeah, that's easy. You should go to Times Square at 1.34 am on a Wednesday and wear a purple hat with black dots. An alien ship will pick you up there and take care of the rest.""