Skip to content

Instantly share code, notes, and snippets.

const assert = require('assert');
const pinericosas = require('./index');
assert.ok(typeof pinericosas.randomQuote === 'function');
const assert = require('assert');
const pinericosas = require('./index');
assert.ok(typeof pinericosas.randomQuote === 'function');
language: node_js
node_js:
- '8'
{
"name": "pinericosas",
"version": "0.1.0",
"description": "Get a random \"piñericosa\"",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
const mapStateToProps = (state) => {
return {
isAdding: state.isAdding,
}
};
const mapDispatchToProps = (dispatch) => {
return {
toggleAdding: () => {
dispatch({ type:'TOGGLE_IS_ADDING' })
@muZk
muZk / README.md
Created May 26, 2017 19:20
Paperclip: how to move existing attachments to a new path
# my_payment_factory
FactoryGirl.define do
factory :my_payment do
after(:build) do |my_payment, evaluator|
my_payment.shopping_cart = FactoryGirl.create(:shopping_cart)
end
end
@muZk
muZk / mysql_create.rake
Created October 28, 2016 02:55
Rails rake task for creating a mysql user and password
namespace :db do
task 'mysql:create' do
puts '== Database Configuration =='
app_name = Rails.application.class.parent_name.underscore
database_name = ENV['database'] || "#{app_name}_db_#{Rails.env}"
database_user_name = ENV['database_user'] || "#{app_name}_user_#{Rails.env}"
database_user_password = ENV['database_password'] || ''
@muZk
muZk / vertical-align.css
Created July 14, 2016 16:51
CSS Vertical align
.vertical-aligned{
height: 100px;
display: table;
}
.vertical-content{
display: table-cell;
vertical-align: middle;
}
@muZk
muZk / addon_englisj.json
Created November 29, 2015 20:30
Example JSON dump
{
"Heroes": {
"npc_dota_hero_antimage": {
"abilities": {
"1": {
"affects": null,
"behavior": "Point Target",
"cooldown": "21.0 18.0 15.0 12.0",
"damage": null,
"damage_type": null,