Skip to content

Instantly share code, notes, and snippets.

View alincc's full-sized avatar

Alin Capitanescu alincc

View GitHub Profile
@alincc
alincc / ImageTools.es6
Created April 1, 2017 08:59 — forked from dcollien/ImageTools.es6
Resize Images in the Browser
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
}());
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () {
try {
@alincc
alincc / gist:e5f3bae176b37c963cd440f7c718fe3e
Created January 19, 2017 16:38 — forked from AndrewSoltes/gist:4106317
set up kdiff3 with git
git config --global merge.tool kdiff3
git config --global mergetool.keepBackup false
#on windows
git config --global mergetool.kdiff3.path 'G:\win\KDiff3\kdiff3.exe'
#remove backups option in kdiff3 settings
@alincc
alincc / GulpFile.js
Created May 27, 2016 22:32 — forked from dhoko/GulpFile.js
Minimal setup for Gulp and Angular
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
ngAnnotate = require('gulp-ng-annotate'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
sourcemaps = require('gulp-sourcemaps');
@alincc
alincc / Gulpfile.js
Created May 27, 2016 22:32 — forked from Dpblandin/Gulpfile.js
Gulpfile [Laravel, Angular]
var gulp = require('gulp');
var sequence = require('run-sequence');
var es = require('event-stream');
var clean = require('gulp-clean');
var htmlReplace = require('gulp-html-replace');
var inject = require('gulp-inject');
var compass = require('gulp-compass');
var minifyCSS = require('gulp-minify-css');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
@alincc
alincc / gist:91011198c41594da964c8685b7d80c3a
Created May 27, 2016 08:45 — forked from ScottGuymer/gist:9910569
angular directive to format a number in an input
var common = angular.module('common', []);
/** allows numbers to be displayed from a model value with the correct decimal rounding */
common.directive('inputCurrency', function ($filter, $locale) {
return {
terminal: true,
restrict: 'A',
require: '?ngModel',
link: function (scope, element, attrs, ngModel) {
@alincc
alincc / angular-snippet.js
Created April 19, 2016 15:20 — forked from anonymous/angular-snippet.js
AngularJS snippet for Chrome, to debug apps
var injector = angular.injector(["ng"]);
var func = function($http) {
};
injector.invoke(func);
@alincc
alincc / CompletableFuture.java
Created March 2, 2016 07:49 — forked from jxerome/demo.java
Invoice Repository
// Index
@Repository
public class InvoiceByLastNameRepository extends IndexRepository<String> {
public InvoiceByLastNameRepository() {
super("invoice_by_lastname", "lastname", Invoice::getLastName);
}
}
public abstract class IndexRepository<T> {
package org.robotninjas.util.concurrent;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.util.concurrent.*;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
@alincc
alincc / draggable.js
Created February 21, 2016 22:44 — forked from siongui/draggable.js
AngularJS draggable element (position must be absolute)
/**
* @see https://github.com/siongui/palidictionary/blob/master/static/js/draggable.js
* @see http://docs.angularjs.org/guide/compiler
*/
angular.module('draggableModule', []).
directive('draggable', ['$document' , function($document) {
return {
restrict: 'A',
link: function(scope, elm, attrs) {
@alincc
alincc / nginx.conf
Created November 20, 2015 14:29 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}