Skip to content

Instantly share code, notes, and snippets.

View rajivseelam's full-sized avatar

Rajiv Seelam rajivseelam

View GitHub Profile
@jadell
jadell / Actor.php
Last active June 2, 2016 07:55
Neo4j and PHP sample application
<?php
use Everyman\Neo4j\Node,
Everyman\Neo4j\Index;
class Actor
{
public $id = null;
public $name = '';
protected $node = null;
@mattbaker
mattbaker / README
Created December 22, 2011 06:02
SVG to PNG render with Node and D3.js
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
@vitch
vitch / apply-styles.css
Created August 1, 2012 13:44
SVG background images on d3 fills
#graph svg g.us rect
{
fill: url(#tile-us) #cccccc;
}
#graph svg g.worldwide rect
{
fill: url(#tile-ww) #cccccc;
}

Sentry is an amazing auth system. But I really need a feature: multiple user types in the same app. And I cannot separate those in groups, because they have different table columns. After 2 days burning my head, I think I found a good solution. The magic is duplicate SentryServiceProvider with new different settings.

Lets suppose we have a fresh Sentry install with default User ambient. Now we want another ambient called Admin, with new model and different settings. How to do:

1. One model, one ambient

Let's create one model called Admin for our new ambient.

@nicolashery
nicolashery / README.md
Last active August 23, 2019 23:28
D3.js chart with panning and paging

Click, hold, and drag chart background to pan left & right. When you see the "More" button, click to load next page of data.

Problem

I put this together while trying to find a simple solution to the following problem and contraint:

  • Visualize a potentially large set of timeseries data (stored behind an API)
  • Render fast, stay lean, and don't take up too much browser memory or computation

The paging means that we're always working with the same amount of data in memory (in this example, 1 day of data), and that we're allowed to explore as far back/forward in time as we like. I found this solution simple and easy to work with, but we could imagine something fancier like automatically fetching and rendering the next chunk of data when we reach the edge.

@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active February 25, 2025 22:09
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@umanda
umanda / 1. Multiple user type for Laravel 4.md
Last active November 19, 2019 20:08
Multiple user type for Laravel 4.2 and Sentry 2.

Recently I wanted to have a system with multiple user loggings with Laravel and Sentry 2. I was searched over the internet and I found a nice solution from leabdalla.

https://gist.github.com/leabdalla/5999421

Unfortunately this solution is working only Laravel 4.0 and Sentry 2. I have noted leabdalla post his GITS in 2013 and meantime laravel and Sentry has some updates. Therefor leabdalla’s code not working with latest Laravel and Sentry releases.

I have fixed that issue and my changes are compatible with Latest Laravel releases. As well as this might be not work with future changes in laravel as well as sentry

@franquis
franquis / PostController.php
Last active February 4, 2023 03:12
Summernote image upload with PHP (Laravel + Intervention\lmage)
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@JeffreyWay
JeffreyWay / laravel-elixir-webpack.js
Last active February 9, 2019 04:31
Laravel Elixir Webpack Extension
var gulp = require('gulp');
var gulpWebpack = require('webpack-stream');
var Elixir = require('laravel-elixir');
var $ = Elixir.Plugins;
var config = Elixir.config;
/*
|----------------------------------------------------------------
| Webpack Compilation