This file contains hidden or 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
class MyCustomEstimator < SolidusEasypost::Estimator | |
def shipping_rates(package, frontend_only = true) | |
# your custom logic | |
end | |
end |
This file contains hidden or 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
> cat test/adventure.test.js | |
const LegacyAdventure = require('../adventure') | |
const test = require('tape') | |
test('LegacyAdventure', (t) => { | |
const workshopper = new LegacyAdventure('test-workshopper') | |
t.plan(2) | |
t.ok(workshopper) | |
t.equal(workshopper.title, 'test-workshopper') |
This file contains hidden or 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> | |
<body> | |
<template id='moz-meetup'> | |
<p><slot name='message'>Hello meetup</slot></p> | |
</template> | |
<moz-meetup> | |
<p slot='message'> | |
another message | |
</p> |
This file contains hidden or 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
# Updates packages | |
sudo apt-get update -y | |
# Installs requirements packages | |
sudo apt-get install -y curl git-core build-essential postgresql libpq-dev nodejs | |
# Install rvm | |
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import | |
curl -sSL https://get.rvm.io | bash -s stable | |
echo 'source ~/.rvm/scripts/rvm' >> ~/.bashrc |
This file contains hidden or 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
{ | |
"manifest_version": 2, | |
"name": "notification", | |
"version": "0.1", | |
"applications": { | |
"gecko": { | |
"id": "[email protected]" | |
} | |
}, |
This file contains hidden or 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 'minitest/autorun' | |
module Flatten | |
def flatten_arr arr | |
return error_msg unless arr.is_a? Array | |
new_arr = [] | |
deep_flat(arr, new_arr) | |
end |
This file contains hidden or 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
// canvas animation | |
window.requestAnimationFrame = window.requestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.msRequestAnimationFrame; | |
var circles = []; | |
var canvas = document.getElementById('animation'); | |
var ctx = canvas.getContext('2d'); |
This file contains hidden or 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
likes = FBLike.uniq.pluck(:name) | |
require "csv" | |
CSV.open("file.csv", "wb") do |csv| | |
csv << ["like_page", "counts"] | |
likes.each do |like| | |
like_counts = User.includes(:fb_likes).where(fb_likes: {name: like}).count | |
csv << [like, like_counts] | |
end | |
end |
This file contains hidden or 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
server { | |
listen 80; | |
server_name openx.stoptv.pe; | |
root /var/www/openx; | |
index index.php; | |
passenger_enabled off; | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
This file contains hidden or 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": “MyApp", | |
"description": “Hello World!", | |
"launch_path": "/index.html", | |
"developer": { | |
"name": "The Gaia Team", | |
"url": "https://github.com/mozilla-b2g/gaia" | |
}, |
NewerOlder