Skip to content

Instantly share code, notes, and snippets.

View Schniz's full-sized avatar

Gal Schlezinger Schniz

View GitHub Profile
@Schniz
Schniz / DeadCenter.vba
Created October 8, 2014 13:30
Powerpoint Dead Center vba macro
Sub DeadCenter()
On Error Resume Next
ActiveWindow.Selection.shapeRange.Align msoAlignCenters, msoTrue
ActiveWindow.Selection.shapeRange.Align msoAlignMiddles, msoTrue
End Sub
@Schniz
Schniz / emtester.jsx
Created February 7, 2015 22:00
React.js EmTester
var EmTester = React.createClass({
propTypes: {
onSize: React.PropTypes.func.isRequired
},
getStyles: function() {
return {
position: 'absolute',
top: 0,
left: 0,
visibility: 'hidden',
@Schniz
Schniz / webpack.config.js
Created April 18, 2015 10:04
webpack example
"use strict";
var webpack = require('webpack');
var webpackConf = {
cache: true,
entry:
{
main: './views/react/app.js'
},
@Schniz
Schniz / README.md
Last active August 29, 2015 14:22
AMQParty

AMQParty

Instead of using exchnage and queues and stuff..

const amqparty = require('amqparty'); // default instance of amqparty.Amqparty;
amqparty.connect({ ...amqpProperties }).then(() => {
  console.log("Connected..");
  const send = amqparty.sender({ exchange: 'joe', name: 'userInfo' });
@Schniz
Schniz / flux.js
Created June 11, 2015 17:01
flux ideas
const Im = require('immutable');
const React = require('react');
class Store {
}
const createStore = (storeMethods) => {
const store = new Store();
store.setMethods(storeMethods);
@Schniz
Schniz / listen.js
Created June 11, 2015 19:50
listen to store decorator for microcosm/reactjs integration.
/**
* listenToStore decorator for Microcosm.
*
* Usage:
* ------
* ```
* @listen('storeName') // or @listen(['storeOne', 'storeTwo'])
* class Component extends React.Component {
* render() {
* return (<div>{ this.props.storeName.somethingInTheStore }</div>);
@Schniz
Schniz / recordAndReplayTesting.md
Created July 6, 2015 15:30
Record and Replay Testing
describe('E2E tests', () => {
  it('should add a todo to the list', (done) => {
    RnrTesting.run([{
      actionName: 'NAVIGATE_TO',
      payload: {
        path: '/todos',
      }
    }, {
 actionName: 'TOGGLEL_NEW_TODO',
@Schniz
Schniz / app-example.js
Created July 15, 2015 15:33
Microcosm.js React Provider Component
// Kickstarting the app in the client side...
// Here we will call the main `React.render`
const React = require('react');
const routes = require('./routes');
const Flux = require('flux');
const { Router } = require('react-router');
const BrowserHistory = require('react-router/lib/BrowserHistory');
const history = new BrowserHistory();
const flux = window.flux = new Flux();
@Schniz
Schniz / rest-query.md
Created October 2, 2015 06:58
Yahoo!'s xchange REST query for college

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22USDILS%22%2C%20%22EURILS%22%2C%20%22GBPILS%22)&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback=?

@Schniz
Schniz / private.xml
Last active October 7, 2015 19:58
Karabiner private xml: Change input source with Right ⌘.
<?xml version="1.0"?>
<root>
<item>
<name>Use Right Command to toggle input sources</name>
<identifier>private.right_command_to_toggle_input_sources</identifier>
<block>
<inputsource_only>HEBREW</inputsource_only>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::VK_CHANGE_INPUTSOURCE_ENGLISH</autogen>
</block>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::VK_CHANGE_INPUTSOURCE_HEBREW</autogen>