Skip to content

Instantly share code, notes, and snippets.

View bekatom's full-sized avatar
🎯
Focusing

Beka Tomashvili bekatom

🎯
Focusing
View GitHub Profile
@bekatom
bekatom / couchdb_authentication.js
Created December 9, 2016 15:17
couchdb_authentication.js
var request = require("request");
var options = { method: 'POST',
url: 'http://couchbase_host:4984/dbname/_session',
headers:
{ 'postman-token': '655ec530-e665-6bdf-ac52-2bcf62ff14ab',
'cache-control': 'no-cache',
'content-type': 'application/json' },
body: { name: 'username', password: 'password' },
json: true };
@bekatom
bekatom / Regex.md
Created December 7, 2016 14:23 — forked from interisti/Regex.md
Regex

Match unicode chars:

[^\u0000-\u007F]

Match nonunicode chars:

[!^\u0000-\u007F]
@bekatom
bekatom / javascript.json
Created November 25, 2016 15:52
vscode_snippet_for_tron
"Display state tron": {
"prefix": "displayState",
"body": [
"console.tron.display({",
"\t$3name: 'State',",
"\t$3value: this.state,",
"});"
],
"description": "Log state to tron"
}
@bekatom
bekatom / couch_sync_gateway.json
Created October 15, 2016 18:27
couch_sync_gateway
{
"log": ["*"],
"databases": {
"db": {
"server": "http://192.168.5.103:8091/",
"bucket": "default",
"users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } }
}
}
}
@bekatom
bekatom / soundutil.js
Created June 2, 2016 10:07
Sound utils , browser check
(function(window){
function SoundTest(){
this.browserTest = function browserTest(){
console.log("browser test");
};
@bekatom
bekatom / index.js
Last active May 19, 2016 13:12
React render as service node application
module.exports = {
renderController : require('./renderController.v1.js')
};
@bekatom
bekatom / ReactHelper.class.php
Created April 22, 2016 10:51
ReactHelperClass
<?php
/**
* Created by PhpStorm.
* User: beka
* Date: 4/4/16
* Time: 11:59 AM
*/
namespace LSCore;
@bekatom
bekatom / app.js
Created April 12, 2016 05:28
AllowCrossDomain Request , in multiple site only
function allowCrossDomain(req, res, next) {
res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.header('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
res.header('Access-Control-Allow-Credentials', true);
var origin = req.headers.origin;
if (_.contains(config.allowed_origins, origin)) {
res.setHeader('Access-Control-Allow-Origin', origin);
@bekatom
bekatom / util.js
Created April 11, 2016 07:40
my util.js , some helpers for javascript modules
/**
* Created by beka on 4/10/16.
*/
module.exports = {
base64_encode: function (file){
var fs = require('fs');
var bitmap = fs.readFileSync(file);
return new Buffer(bitmap).toString('base64');
@bekatom
bekatom / app.jsx
Created March 28, 2016 09:21
react.js loop with object
var MenuCategories = React.createClass({
getInitialState: function() {
return {
data: [],
temp : "beka tomashvili"
};
},
componentDidMount: function() {
this.serverRequest = $.get(this.props.source, function (result) {