- Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
- rabl - General ruby templating with json, bson, xml, plist and msgpack support
- Thin - Very fast and lightweight Ruby web server
- Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
- SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
- Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
- [factory_girl](h
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
@font-face { | |
font-family: 'ABeeZee'; | |
font-style: normal; | |
font-weight: 400; | |
src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://fonts.gstatic.com/s/abeezee/v9/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype'); | |
} | |
@font-face { | |
font-family: 'Abel'; | |
font-style: normal; | |
font-weight: 400; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<p>Hello World!</p> | |
<button id="showButton" >Click me</button> | |
<div id="screenshot"></div> | |
</body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="background.js"></script> | |
</head> | |
<body> | |
<textarea id="sandbox"></textarea> | |
</body> |
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
/** Async version of Array.prototype.reduce() | |
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => { | |
* acc[v] = await (await fetch(v)).json(); | |
* return acc; | |
* }, {}); | |
*/ | |
export async function reduce(arr, fn, val, pure) { | |
for (let i=0; i<arr.length; i++) { | |
let v = await fn(val, arr[i], i, arr); | |
if (pure!==false) val = v; |
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
import React, { Component, useCallback, useState, useRef } from "react"; | |
import "./App.css"; | |
const imgUrl = require("./assets/iPhone-XS-Portrait-Space-Gray.png"); | |
const fullSize = { | |
width: 1325, | |
height: 2616 | |
}; |
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
(function() { | |
if (window._PagSeguroDirectPayment) { | |
return; | |
} | |
function onDocumentReady(callback) { | |
var eventName = document.addEventListener ? "DOMContentLoaded" : "onreadystatechange"; | |
if (document.readyState === "complete" || (document.readyState !== "loading" && !document.attachEvent)) { | |
callback(); | |
return; |
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
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
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
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
doc = open('http://railscasts.com/') { |f| Hpricot(f) } | |
total_episodes = (doc/'div.number').first.inner_html[1,3].to_i | |
total_pages = (total_episodes / 10).ceil | |
(1..total_pages).each do |i| | |
puts "PAGE #{i} ================================" |
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
#!/usr/bin/ruby | |
require 'rss' | |
p 'Downloading rss index' | |
rss_string = open('http://feeds.feedburner.com/railscasts').read | |
rss = RSS::Parser.parse(rss_string, false) | |
videos_urls = rss.items.map { |it| it.enclosure.url }.reverse | |
videos_filenames = videos_urls.map {|url| url.split('/').last } |
NewerOlder