Skip to content

Instantly share code, notes, and snippets.

:octocat:
-_^

Ajinkya Borade steelx

:octocat:
-_^
Block or report user

Report or block steelx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steelx
steelx / gulpfile-express.js
Created Nov 2, 2015 — forked from mollerse/gulpfile-express.js
Gulpfile for livereload + static server
View gulpfile-express.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
View README.md

This files contains my boilerplates for jQuery plugins.

View Super Simple Ajax File Upload (XHR2)
// Ajax File upload with jQuery and XHR2
// Sean Clark http://square-bracket.com
// xhr2 file upload
// data is optional
$.fn.upload = function(remote,data,successFn,progressFn) {
// if we dont have post data, move it along
if(typeof data != "object") {
progressFn = successFn;
successFn = data;
}
@steelx
steelx / LESS-css-quicky
Created Oct 29, 2013
LESS css quick copy paste
View LESS-css-quicky
@mobile: ~"only screen and (max-width: 529px)";
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)";
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)";
@desktop-xl: ~"only screen and (min-width: 1129px)";
View generateLocales.js
var fs = require('fs');
// Specify the locales you are interested here.
var locales = ['en', 'fr'];
var i;
var localesData = Object.create(null);
var prefix = 'data:text/javascript;base64,';
var outputPrefix = "angular.module('tmh.dynamicLocalePreload', ['tmh.dynamicLocale'])" +
".config(['tmhDynamicLocaleProvider', function(tmhDynamicLocaleProvider) {" +
"tmhDynamicLocaleProvider.localeLocationPattern('{{base64Locales[locale]}}');" +
@steelx
steelx / Fullstack Helper tools
Created Jan 15, 2018
Creating backend API's and Database easy scripts links and notes
View Fullstack Helper tools
- https://github.com/mongo-express/mongo-express
@steelx
steelx / generateThumb.js
Last active May 14, 2018
firebase functions thumbnail
View generateThumb.js
const mkdirp = require('mkdirp-promise');
const gcs = require('@google-cloud/storage')({ keyFilename: 'service-account-key.json' });
const admin = require('firebase-admin');
var serviceAccount = require('./service-account-key.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: 'https://<PROJECT_ID>.firebaseio.com'
});
@steelx
steelx / rxjs-behaviour-subject-store.ts
Last active Jul 26, 2018
rxjs-behaviour-subject-store (redux alike store with Rxjs)
View rxjs-behaviour-subject-store.ts
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
export class Store<T> {
private _state$: BehaviorSubject<T>;
protected constructor(initialState: T) {
this._state$ = new BehaviorSubject(initialState);
}
@steelx
steelx / listFiles.js
Created May 13, 2018
firebase storage list files
View listFiles.js
// listFiles.js
const gcs = require('@google-cloud/storage')({keyFilename: 'service-account-key.json'});
module.exports = function listFiles(request, response) {
if(!request.body.uid) {
response.status(422).send({error: "Missing UID"});
}
console.log("request.body.uid", request.body.uid);
// Creates a client
const bucketName = '<HIDDEN PROJECT ID>';
@steelx
steelx / getGravatarUrl
Created Dec 2, 2013
AngularJS get Gravatar url on email
View getGravatarUrl
var ajinkyaApp = angular.module('ajinkyaApp', []);
ajinkyaApp.controller('EditProfileController', function($scope){
$scope.user = {};
$scope.getGravatarUrl = function(email) {
// MD5 (Message-Digest Algorithm) by WebToolkit
//
var defaultGravatarPic = 'http://www.gravatar.com/avatar/000.jpg?s=200';
You can’t perform that action at this time.