Skip to content

Instantly share code, notes, and snippets.

Avatar
🍰
is a lie

Dmitry Chirkin josser

🍰
is a lie
View GitHub Profile
View .phoenix.js
'use strict';
var keys = [];
var controlAlt = [ 'ctrl', 'alt' ];
var margin = 0;
var increment = 0.1
function log() {
Phoenix.log(JSON.stringify(arguments[0], true, 2));
}
View keybase.md

Keybase proof

I hereby claim:

  • I am josser on github.
  • I am josser (https://keybase.io/josser) on keybase.
  • I have a public key ASBnqM8fMlxKvEMi1UvJfqsUHnrz7XGGo-LCDfOGdJLNuQo

To claim this, I am signing this object:

View user_ldap.js
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://10.10.0.10'
});
client.bind('user@donaim', 'pw', function(error) {
if (error) {
View gist:4fb2b816f059e329f52a69fca1b3d251
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://10.10.0.10'
});
client.bind('user@donaim', 'pw', function(error) {
if (error) {
View .phoenix.js
'use strict';
var keys = [];
var controlAlt = [ 'ctrl', 'alt' ];
var margin = 0;
var increment = 0.1
function log() {
Phoenix.log(JSON.stringify(arguments[0], true, 2));
}
View reducers_todos.js
import { ADD_TODO } from 'constants/ActionTypes'
export const initialState = [
{
text: 'Use Redux',
completed: false,
id: 0
}
]
@josser
josser / foo.test.js
Last active Mar 21, 2016
Is it ok to use initialState as stub for reducer tests importing it from reducer itself?
View foo.test.js
// Is it ok to use initialState as stub for reducer tests importing it from reducer itself?
import { initialState, fooReducer } from './reducers/foo';
var reducedState = { ... initialState }
reducedState.name = 'bar';
expect(fooReducer(initialState)).to.eql(reducedState);
View momthy_floor.js
var iterations = 100000000;
var stats = {
win: 0,
loose: 0
}
function generatePrises() {
var initial = [0, 0, 0];
initial[Math.floor(Math.random() * 3)] = 1;
View query.sql
with tbl2_view as (
with tbl3_view as (
with tbl4_view as (
select * from tbl4
)
select tbl3.*, json_agg(tbl4_view) as tbl4 from tbl3
inner join tbl4_view on tbl4_view.tbl3_id = tbl3.id
group by tbl3.id
)
View test.jsx
import React, { Component } from 'react';
import AceEditor from 'react-ace';
import brace from 'brace'
import sql from 'brace/mode/sql';
import xcode from 'brace/theme/xcode';
export default class Explorer extends Component {
constructor(args) {
super(args);