Skip to content

Instantly share code, notes, and snippets.

@amaseda
amaseda / sample-post.md
Last active April 13, 2017 13:54
sample-post.md

Sample Post

The below snippet is what you would see when viewing a post under the "Text" tab on the Wordpress post edit page.

Things to note...

  • There is a space between each distinct item. For example, there is an empty line both above and below the divider.
  • There is NO DIVIDER below the video. Just above it.
<img class="alignnone size-full wp-image-82171" src="http://www.allthingsgomusic.com/wp-content/uploads/2017/02/pwr-bttm-e1487360744368.jpg" alt="pwr bttm" width="660" height="440" />
@amaseda
amaseda / big-o-questions.md
Last active March 30, 2017 13:18
big-o-questions.md

Big-O Notation Exercises

What is the worst-case time complexity for the following algorithms?

#1

def word_occurrence(word, phrase)
  result = 0
  array  = phrase.split(' ')
@amaseda
amaseda / editorial-checklist.md
Last active December 7, 2017 21:28
editorial-checklist.md

Preview

  • Did you preview the post and make sure that everything looks right?

Feed

  • Is there an excerpt?
  • Is there a feed image?
  • Does the feed image look correct (e.g., no cut-off text, no cut-off borders)
@amaseda
amaseda / code-wars-challenges-solutions.md
Created February 14, 2017 15:04
code-wars-challenges-solutions.md

Count Characters in a String

.forEach

function count(string) {  
  history = {}{
  string.split("")
        .forEach(char => {
 if(history[char]){
@amaseda
amaseda / encrypt-code-challenges.md
Last active October 12, 2016 12:51
encryption code challenges

Encryption Code Challenges

Team up with a partner and pick a code challenge. You will spend 15 minutes solving it individually. After 15 minutes -- even if you are not finished -- you will spend 10 minutes reviewing review each other's code. Some things to discuss

  • Approach
  • Where you got stuck
  • Opportunities for refactoring

Maskify

@amaseda
amaseda / follow-the-json.rb
Last active July 27, 2016 14:17
follow-the-json
require "httparty"
def retrieve(id=nil)
url = "http://letsrevolutionizetesting.com/challenge.json"
if id
url += "?id=" + id
end
response = HTTParty.get(url)
new_id = response["follow"].split("?id=")[-1]
retrieve(new_id)
hall_oates = Artist.create({
name: "Hall & Oates",
photo_url: "greatest_band_evar.jpg",
nationality: "Philly"
})
limp_bizkit = Artist.create({
name: "Limp Bizkit",
photo_url: "fred_durst.png",
nationality: "Jacksonville"
@amaseda
amaseda / atg-fb-widget.md
Created March 1, 2016 15:29
atg-fb-widget

Include the JavaScript SDK on your page once, ideally right after the opening tag.

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=1705906936318742";
 fjs.parentNode.insertBefore(js, fjs);
var featureCollection = {
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-77.0339403, 38.9048542]
 }
map.on( "click", function( event ){
  var lat = event.latlng.lat,
      lng = event.latlng.lng;
  var marker = L.marker([lat, lng]).addTo(map);
  marker.bindPopup("<p>" + event.latlng.lat + "</p><p>" + event.latlng.lng + "</p>");
});