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 'carrierwave/processing/mini_magick' | |
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
def store_dir | |
"files/#{model.id}" |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// reproduce sass darken/lighten/fade function syntax on top of | |
// postcss-color-function (https://github.com/postcss/postcss-color-function) via | |
// postcss-functions https://github.com/andyjansson/postcss-functions | |
// https://github.com/jonathantneal/precss/issues/38 | |
// postcss-sass-colors.js | |
const colorFn = require('css-color-function') | |
function applyFn(value, fn, frac) { | |
return colorFn.convert('color(' + value + ' ' + fn + '(' + frac + '))') |
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
# Use an official Python runtime as a parent image | |
FROM python:2.7-slim | |
# Set the working directory to /app | |
WORKDIR /app | |
# Copy the current directory contents into the container at /app | |
COPY . /app | |
# Install any needed packages specified in requirements.txt |
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
cmake_minimum_required (VERSION 2.6) | |
set(FILL_UTIL "${PROJECT_SOURCE_DIR}/utils/fill") | |
set(SIZE_UTIL "${PROJECT_SOURCE_DIR}/arch/i386/size.sh") | |
set(cpu_objects main.c task.c pgrequest.c descriptor.c thread.c tss.c interrupt.c paging.c memory.c caps.c permissions.c ttrace.c) | |
set(prt_objects print.c) | |
set(assembly_src cpu-asm.s arch/i386/kernel/int.s arch/i386/kernel/pic.s arch/i386/kernel/stack_winding.s arch/i386/kernel/state_switch.s arch/i386/kernel/syscall-gates.s arch/i386/kernel/vga.s) | |
#add_custom_command(OUTPUT assembly.o COMMAND ${AS} ${AS_FLAGS} -o assembly.o ${assembly_src}) |
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 'ruby-prof' | |
require 'benchmark' | |
module BenchmarkHelpers | |
PROFILE_OUTPUT_DIR = "profiling" | |
def self.safe_filename(name) | |
name.gsub(" ", "_") | |
end | |
def self.example_output_target_file!(example) |
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
/** | |
* @typedef {Object} | |
*/ | |
var vendor = Vendor = {}; | |
///** | |
// * @constructor | |
// */ | |
//Vendor.VendorType = function() {}; |
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
/** | |
* Copyright 2012 Incandescent Software LLC | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
# config/initializers/comfortable_mexican_sofa.rb | |
require 'cms_renderer' | |
# lib/cms_renderer.rb | |
require 'action_view/renderer/renderer' | |
require 'action_view/renderer/template_renderer' | |
class CMSRenderer < ActionView::TemplateRenderer |
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 ( | |
"regexp" | |
"os" | |
"io/ioutil" | |
) | |
func main() { | |
regexp, _ := regexp.Compile(os.Args[1]) |
NewerOlder