Skip to content

Instantly share code, notes, and snippets.

@Rakonda
Rakonda / gist:c6d85aaa3ce18e7d18bc6dd0277a6fd7
Created December 19, 2023 09:05
Fix git merge request shows changes from another merge request
Go to your master branch and do a "git pull"
Switch back to your branch you are merging and do "git rebase origin/master -i"
Solve any conflicts that arise and fix any commits as needed in VIM and exist ":wq"
After the rebase is completed do a "git push origin [your branch name] --force"
@Rakonda
Rakonda / example.component.ts
Created August 30, 2017 13:54 — forked from ckimrie/example.component.ts
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {
@Rakonda
Rakonda / workflow-gulpfile.js
Created August 2, 2017 08:00
Sample gulpfile with browserify proxy
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
// var livereload = require('gulp-livereload');
var refresh = require('gulp-refresh');
var connect = require('gulp-connect');
var path = require('path');
var less = require('gulp-less');
var exec = require('gulp-exec');
@Rakonda
Rakonda / angular-directives
Created March 6, 2017 14:27 — forked from awerlang/angular-directives
Angular.js directives sorted by priority
/*
I've compiled a list of angular directives according to their priorities (from most priority to lesser priority).
Also, terminal property is included for each directive that asserts it
*/
ng-switch 1200
ng-repeat 1000 terminal
ng-if 600 terminal
ng-controller 500
ng-init 450
@Rakonda
Rakonda / countries.json
Created January 19, 2017 10:08 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@Rakonda
Rakonda / ion-tabs-swipable.js
Created November 8, 2016 09:45 — forked from taivo/ion-tabs-swipable.js
Swipe navigation for ion-tabs (for ionic framework v 1.0.0)
angular.module('yourModule')
.directive('tabsSwipable', ['$ionicGesture', function($ionicGesture){
//
// make ionTabs swipable. leftswipe -> nextTab, rightswipe -> prevTab
// Usage: just add this as an attribute in the ionTabs tag
// <ion-tabs tabs-swipable> ... </ion-tabs>
//
return {
restrict: 'A',
require: 'ionTabs',
@Rakonda
Rakonda / rAF.js
Created July 25, 2016 16:40 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@Rakonda
Rakonda / IonicCordovaNetwork.js
Created May 18, 2016 16:01 — forked from welcoMattic/IonicCordovaNetwork.js
Async navigator.connection.type service for Ionic Framework
var myApp = angular.module('myApp').service('CordovaNetwork', ['$ionicPlatform', '$q', function($ionicPlatform, $q) {
// Get Cordova's global Connection object or emulate a smilar one
var Connection = window.Connection || {
"CELL" : "cellular",
"CELL_2G" : "2g",
"CELL_3G" : "3g",
"CELL_4G" : "4g",
"ETHERNET" : "ethernet",
"NONE" : "none",
"UNKNOWN" : "unknown",
@Rakonda
Rakonda / app.js
Last active February 6, 2016 23:00
Angular ng-repeat in reverse
var app = angular.module('demo-reverse', []);
app.controller('itemsCtrl', function ($scope) {
$scope.items_array = ['1', '2', '3', '4', '5', '6'];
});
@Rakonda
Rakonda / image-service.js
Created December 30, 2015 16:19 — forked from transitive-bullshit/image-service.js
Angular service to resize images with antialiasing for use with canvas.
angular.module('demo').service('imageService', function ($http, $q, $timeout) {
var NUM_LOBES = 3
var lanczos = lanczosGenerator(NUM_LOBES)
// resize via lanczos-sinc convolution
this.resize = function (img, width, height) {
var self = { }
self.type = "image/png"
self.quality = 1.0