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
-- Grass | |
-- Use this function to perform your initial setup | |
function setup() | |
field = mesh() | |
--field.shader = shader("Documents:Grass") | |
field.shader = shader(GrassShader.vertexShader, GrassShader.fragmentShader) | |
bladeWidth = 0.15 | |
bladeHeight = 1.5 | |
midWeight = 0.4 |
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
var sip = require('sip'); | |
var sys = require('sys'); | |
var redis = require('redis'); | |
//Trim leading and trailing whitespace from string values. | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
sip.start({},function(request) { |
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
# db/migrate/20131118172653_create_transactional_items_view.rb | |
class CreateTransactionalItemsView < ActiveRecord::Migration | |
def up | |
select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read } | |
# for materialized view: | |
view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})" | |
# for normal view: | |
view_sql = "CREATE VIEW transactional_items AS (#{select_sql})" | |
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
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb | |
CAPYBARA_TIMEOUT_RETRIES = 3 | |
RSpec.configure do |config| | |
config.around(:each, type: :feature) do |ex| | |
example = RSpec.current_example | |
CAPYBARA_TIMEOUT_RETRIES.times do |i| | |
example.instance_variable_set('@exception', nil) | |
self.instance_variable_set('@__memoized', nil) # clear let variables |
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
var pack = require('./package.json'); | |
var request = require('request'); | |
var name = pack.name; | |
module.exports = function (shipit) { | |
require('shipit-deploy')(shipit); | |
var deployTo = '/var/www/FOLDER_TO_DEPLOY_TO'; | |
var deployToCurrent = deployTo + '/current'; | |
var slackWebhookURL = 'SLACK_HOOK_URL'; |
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
""" | |
Support for The Shelly Wifi switch. | |
Save this file inside ".homeassistant/custom_components/switch" (create the folders if not present) and restart HASS. | |
usage example: | |
switch: | |
- platform: shelly | |
switches: |
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, PropTypes } from 'react' | |
import { G, Line, Text } from 'react-native-svg' | |
import * as d3scale from 'd3-scale' | |
export default class Axis extends Component { | |
static propTypes = { | |
width: PropTypes.number.isRequired, | |
ticks: PropTypes.number.isRequired, | |
x: PropTypes.number, | |
y: PropTypes.number, |
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
// Deep Breaths // | |
////////////////// | |
// Gulp | |
var gulp = require('gulp'); | |
// Sass/CSS stuff | |
var sass = require('gulp-sass'); | |
var prefix = require('gulp-autoprefixer'); | |
var minifycss = require('gulp-minify-css'); |
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
# Should go into `/etc/nginx/sites-available` as file named `default` | |
# Redirect HTTP to HTTPS | |
server { | |
listen 80; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; |
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
files: | |
"/etc/nginx/conf.d/gzip.conf": | |
mode: "644" | |
owner: "root" | |
group: "root" | |
content: | | |
# enable gzip compression | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; |
OlderNewer