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
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# [email protected] | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
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
- name: Update repositories cache and system deps | |
apt: name={{ item }} state=present update_cache=yes | |
with_items: | |
- libxi6 | |
- libgconf-2-4 | |
- name: Install chromedriver | |
apt: name={{ item }} state=present | |
with_items: | |
- chromium-chromedriver |
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
--- | |
# exists at roles/phantomjs/tasks/main.yml | |
- name: Update repositories cache and system deps | |
apt: name={{ item }} state=present update_cache=yes | |
with_items: | |
- build-essential | |
- chrpath | |
- libssl-dev | |
- libxft-dev |
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} from "react"; | |
import {validateEmail, validateRequired} from "./validations"; | |
class MyForm extends Component { | |
render( | |
return (<Input id="email" | |
placeholder="[email protected]" | |
label="Email (*Required)" | |
type="text" | |
validators={[validateEmail, validateRequired]} |
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 axios from 'axios'; | |
import {toCamelCase, toSnakeCase} from '../util'; | |
import qs from 'qs'; | |
// You can intercept requests or responses before they are handled by then or catch. | |
// https://github.com/axios/axios#interceptors | |
// Add a response interceptor and camelCase return data (for JS) | |
axios.interceptors.response.use((response) => { | |
response.data = toCamelCase(response.data); |
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
package main | |
import ( | |
"fmt" | |
"github.com/fatih/color" | |
"github.com/fsnotify/fsnotify" | |
"log" | |
"os" | |
"path/filepath" | |
"regexp" |
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
from PIL import Image | |
import base64 | |
import numpy | |
from io import BytesIO | |
data_uri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS4AAAEuCAYAAAAwQP9DAAAU80lEQVR4Xu2da+hnRRnHv0qZKV42LDOt1eyGULoSJBGpRBFprBJBQrBJBBWGSm8jld5WroHUCyEXKutNu2IJ1QtXetULL0uQFCu24WoRsV5KpYvGYzM4nv6X8zu/mTnznPkcWP6XPTPzzOf7/L7/OXPmzDlOHBCAAAScETjOWbyECwEIQEAYF0kAAQi4I4BxuZOMgCEAAYyLHIAABNwRwLjcSUbAEIAAxkUOQAAC7ghgXO4kI2AIQADjIgcgAAF3BDAud5IRMAQggHGRAxCAgDsCGJc7yQgYAhDAuMgBCEDAHQGMy51kBAwBCGBc5AAEIOCOAMblTjIChgAEMC5yAAIQcEcA43InGQFDAAIYFzkAAQi4I4BxuZOMgCEAAYyLHIAABNwRwLjcSUbAEIAAxkUOQAAC7ghgXO4kI2AIQADjIgcgAAF3BDAud5IRMAQggHGRAxCAgDsCGJc7yQgYAhDAuMgBCEDAHQGMy51kBAwBCGBc5AAEIOCOAMblTjIChgAEMC5yAAIQcEcA43InGQFDAAIYFzkAAQi4I4BxuZOMgCEAAYyLHIAABNwRwLjcSUbAEIAAxkUOQAAC7ghgXO4kI2AIQADjIgcgAAF3BDAud5IRMAQggHGRAxDwTeDTkr4s6UxJ/5F0QNK3JD3lu1tbR49xLVld+jYXgcskvSTpIkmnS/qgpJMk/Tv8bHHZ7+PXPw6M5kRJx0t6Ijkv9uUsSW+U9Iykczfp4K8lfXiuztdoF+OqQZk2vBEwUzFTsK9mQNFkotGkhvFeSc+G86NRtdDfd0h6tIVASsSAcZWgSp0eCJjJ7JR0SRgZ2SjHDMp+38Jho7PXTAzkBUmvn1jWRTGMy4VMBJmBg |
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 WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer | |
protected |
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.exports = function(config) { | |
config.set({ | |
// base path | |
basePath: './', | |
// frameworks to use | |
frameworks: ['jasmine'], | |
// list of files / patterns to load in the browser |
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
Rails.application.configure do | |
# http://stackoverflow.com/questions/29417328/how-to-disable-cannot-render-console-from-on-rails | |
config.web_console.whitelisted_ips = '10.0.2.2' | |
# Settings specified here will take precedence over those in config/application.rb. | |
# In the development environment your application's code is reloaded on | |
# every request. This slows down response time but is perfect for development | |
# since you don't have to restart the web server when you make code changes. | |
config.cache_classes = false |