Skip to content

Instantly share code, notes, and snippets.

@strikeout
strikeout / BitMEX Jazz BEEP
Last active July 30, 2020 19:06
Aural indication of XBTUSD price movements via BitMEX websocket realtime-trade data. Uses the blues scale to add some funk to your trading. Copy & paste into your browser's console..
/**
* BitMEX JAZZ BEEP
*
* Aural indication of XBTUSD price movements via BitMEX websocket realtime-trade data.
* Uses the blues scale to add some funk to your trading.
*
*/
var options = {
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@strikeout
strikeout / gist:cfa3c6d009e85a0c78d0
Created February 26, 2015 17:09
Apache vhost config for Meteor with working websockets
<VirtualHost 10.248.206.19:80>
ServerName some.domain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
@maxant
maxant / market.js
Last active November 18, 2022 09:53
Files for creating a trading engine with Node.js.
// /////////////////////////////////////////////////
// this file contains all the classes related to a
// market.
// /////////////////////////////////////////////////
var log4js = require('log4js');
var logger = log4js.getLogger(require('path').basename(__filename, '.js'));
require('es6-collections');
var _ = require('underscore');
/**
@fta2012
fta2012 / DragTransform
Last active October 9, 2022 15:32
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
@fightingtheboss
fightingtheboss / configuration.yml
Last active September 15, 2023 07:29
An Amazon Elastic Beanstalk configuration file for a Meteor project. This file needs to be saved in the .ebconfiguration/ directory at the root of your project. Deployed with `git aws.push`. Replace MONGO_URL with the URL to your MongoDB instance (I use MongoHQ).
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
@loadx
loadx / gist:4069289
Created November 14, 2012 00:08
Ember-data server side validation without deadlocking the record as 'invalid'
App.AddContactController = Em.ArrayController.extend({
init: function(){
this.companies = App.store.findAll(App.Company);
},
beginEdit: function(){
// By default createRecord will add this to the ArrayProxy and it will be rendered
// this property allows us to toggle rendering
this.set('record', App.store.createRecord(App.Contact, {'visible': false}));
},
@racklin
racklin / CliTest.php
Created September 6, 2012 17:46
Phalcon CLI descriptions (invo web)
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2012 Phalcon Team (http://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |