Skip to content

Instantly share code, notes, and snippets.

View sandro's full-sized avatar
☀️
Sharing Goodness

Sandro Turriate sandro

☀️
Sharing Goodness
View GitHub Profile
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SandroTurriate
//@version=4
study("Heiken Ashi Trend")
haopen = security(heikinashi(syminfo.tickerid), timeframe.period, open)
haclose = security(heikinashi(syminfo.tickerid), timeframe.period, close)
//plot(0)
//plot(1, color=haclose <= haopen ? color.red : color.green, style=plot.style_columns)
local humanoid = script.Parent
local jumpHeight = 50
humanoid.JumpPower = jumpHeight
function onJumpRequest()
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
humanoid.JumpPower = jumpHeight * 1.5
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
else
humanoid.JumpPower = jumpHeight
function log(obj) {
Phoenix.log(JSON.stringify(obj));
}
var simpleMover = new function() {
var self = this;
var enabled = false;
var modal = Modal.build({
text: "Move: Up,Down,Left,Right\nGrow/Shrink: Cmd+Up/Down/Left/Right\nRaise windows: w\nRefocus: g\nExit: escape",
origin: function() {
main_bin = ARGV[0]
REPLACES = {
"@@HOMEBREW_PREFIX@@" => `brew --prefix`.chomp,
"@@HOMEBREW_CELLAR@@" => `brew --cellar`.chomp
}
VALID_REPLACE = Regexp.union(REPLACES.keys)
OTOOL = "otool"
CHANGE_TOOL = "install_name_tool"
#!/bin/sh
# credit to https://gist.github.com/stefansundin/d465f1e331fc5c632088
PUSH_COMMAND=`ps -ocommand= -p $PPID`
while read local_ref local_sha remote_ref remote_sha
do
if [[ "$remote_ref" =~ master && "$PUSH_COMMAND" =~ force|delete|-f ]]; then
echo "Prevented force-push to $remote_ref. This is a very dangerous command."
echo "If you really want to do this, use --no-verify to bypass this pre-push hook."
config.after(:suite) do
sessions = Capybara.send(:session_pool).values
pids = sessions.map do |session|
if Capybara::Webkit::Driver === session.driver
session.driver.browser.instance_variable_get(:@connection).pid
end
end
Process.kill("KILL", *pids.compact)
end
@sandro
sandro / gist:8309003
Last active January 2, 2016 13:19
Install Ruby 2 with Rails Express patches using ruby-install.
ruby-install -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/01-zero-broken-tests.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/02-railsexpress-gc.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/03-display-more-detailed-stack-trace.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/04-show-full-backtrace-on-stack-overflow.patch -p https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p353/railsexpress/05-fix-missing-c-return-event.patch ruby 2.0.0-p353
@sandro
sandro / cfunc.c
Last active December 18, 2015 04:39
void ACFunction() {
printf("ACFunction()\n");
AGoFunction();
}
@sandro
sandro / w.rb
Last active December 14, 2015 15:49
require 'rb-fsevent'
unless ENV.has_key?('RSPEC_OPTIONS')
ENV['RSPEC_OPTIONS'] = '--fail-fast'
end
class Watcher
attr_accessor :now, :fsevent, :paths, :wip_enabled
REWRITE_REGEX = %r{(.*)(?:(app/)|(lib/))(.*)\.rb$}
#!/usr/bin/env ruby
# set the 'test' environment variable to test against the expected data at the bottom of the file
# test=1 ruby incoming_email_forwarder.rb
test_mode = ENV['test']
message = test_mode ? DATA : $stdin.read
headers = {}
headers_string = ""