Skip to content

Instantly share code, notes, and snippets.

💭
Creating a new language

Saulo Vallory svallory

💭
Creating a new language
Block or report user

Report or block svallory

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@svallory
svallory / test-index.js
Created Apr 4, 2019
VSCode Stryker Mutator test
View test-index.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/* tslint:disable no-require-imports */
const fs = require("fs");
const path = require("path");
const glob = require("glob");
const paths = require("path");
const istanbul = require('istanbul');
@svallory
svallory / run_them_all.sh
Created Apr 27, 2017
Updates ubuntu with nodejs 6 and yarn
View run_them_all.sh
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get update && sudo apt-get install -y nodejs yarn
@svallory
svallory / nginx-config
Last active Feb 20, 2018
Nginx Wildcard config
View nginx-config
server {
listen 80;
server_name ~^(www\.)?(?<project>.+?).dev$;
root /projects/$project;
index index.html index.htm index.php;
charset utf-8;
location / {
@svallory
svallory / Deploying Sharetribe to Heroku.md
Last active Jul 28, 2019
Deploying Sharetribe to Heroku
View Deploying Sharetribe to Heroku.md

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config
    
@svallory
svallory / netstat -an
Created Aug 25, 2015
Figuring out why nginx dowsn't work on 80
View netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.25.111.58556 94.23.9.195.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58555 91.185.207.128.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58554 91.185.207.128.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58553 23.239.11.213.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58455 192.111.0.25.443 ESTABLISHED
tcp4 0 0 192.168.25.111.58452 64.233.186.95.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58441 186.215.111.105.80 ESTABLISHED
tcp4 0 0 192.168.25.111.58434 173.194.119.4.80 ESTABLISHED
View funding-tracker.js
(function() {
// Localize jQuery variable
var jQuery;
/******** Load jQuery if not present *********/
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') {
var script_tag = document.createElement('script');
script_tag.setAttribute("type","text/javascript");
script_tag.setAttribute("src",
View output
exec error: Error: Command failed: js: "/projects/theblacksmith/tsm/lib/tsm/compiler.ts", line 10: missing ; before statement
js: class Compiler
js: .............^
js: "/projects/theblacksmith/tsm/lib/tsm/compiler.ts", line 12: missing ; before statement
js: public filePattern;
js: ...................^
js: "/projects/theblacksmith/tsm/lib/tsm/compiler.ts", line 14: missing ; before statement
js: private compiledModules = [];
js: ........................^
js: "/projects/theblacksmith/tsm/lib/tsm/compiler.ts", line 15: missing ; before statement
View ServiceOrder.cs
namespace Sparrow.Domain.ServiceOrder
{
using System;
using System.Collections.Generic;
using Iesi.Collections.Generic;
using Jack.Core.Domain;
using Jack.Core.Envent;
@svallory
svallory / sass-one-time-importer.rb
Last active Dec 18, 2015
Sass custom importer which only imports the same file once. Requires colorize to make it easy to debug. You can remove it safely (but make sure to remove all the .red, .blue etc. calls also)
View sass-one-time-importer.rb
require 'colorize'
module Liftr
module Importers
class ImportOnce < ::Sass::Importers::FilesystemFilesystem
attr_accessor :root, :debug_level, :staleness_check, :imported, :original_filename
# Creates a new filesystem importer that imports files relative to a given path.
#
@svallory
svallory / hamlphp.render_partial.php
Created Jun 24, 2013
How to render a partial using HamlPHP
View hamlphp.render_partial.php
<?php
// WARNING: This is the simplest possible example. It could be vastly improved
// by keeping the HamlPHP instance somewhere and, even more important, caching parser results
function render_partial($file, $data) {
$parser = new HamlPHP(new FileStorage('path/to/tmp/'));
$content = $parser->parseFile($file);
echo $parser->evaluateFile($content, $data);
}
You can’t perform that action at this time.