Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Looking for new challenges

KULDIP PIPALIYA kuldipem

:shipit:
Looking for new challenges
View GitHub Profile
@kuldipem
kuldipem / git-branches-by-commit-date.sh
Created Apr 7, 2018 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
View git-branches-by-commit-date.sh
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@kuldipem
kuldipem / install-libsodium.sh
Created Feb 6, 2018 — forked from jonathanpmartins/install-libsodium.sh
Install Libsodium on Ubuntu 14.04.3 LTS Trusty
View install-libsodium.sh
#!/bin/bash
sudo add-apt-repository ppa:chris-lea/libsodium;
sudo echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list;
sudo apt-get update && sudo apt-get install libsodium-dev;
@kuldipem
kuldipem / git cheat sheet.sh
Last active Nov 23, 2017 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
View git cheat sheet.sh
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@kuldipem
kuldipem / ubuntu.sh
Created Nov 23, 2017
ubuntu helping cmds cheatsheet
View ubuntu.sh
gnome-desktop-item-edit ~/Desktop/ --create-new #create new desktop shortcut
View app.component.ts
import {AfterViewInit, Component, ViewChild} from '@angular/core';
import {FetchJsonService} from './services/fetch-json.service';
import {FormBuilderService} from './services/form-builder.service';
import FieldType from './class/ui/form/field/field-type';
import FormType from './class/ui/form/form-type';
import 'brace/mode/html';
import 'brace/mode/typescript';
import { setTimeout } from 'timers';
import './windowFixed.js';
View app.component.ts
import {AfterViewInit, Component, ViewChild} from '@angular/core';
import {FetchJsonService} from './services/fetch-json.service';
import {FormBuilderService} from './services/form-builder.service';
import FieldType from './class/ui/form/field/field-type';
import FormType from './class/ui/form/form-type';
import 'brace/mode/html';
import 'brace/mode/typescript';
import { setTimeout } from 'timers';
import './windowFixed.js';
View random.js
/**
* Returns a random number between min (inclusive) and max (exclusive)
*/
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
/**
* Returns a random integer between min (inclusive) and max (inclusive)
* Using Math.round() will give you a non-uniform distribution!
@kuldipem
kuldipem / class_decorator.ts
Created Aug 5, 2017 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
View class_decorator.ts
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
View WORDPRESS: Base64 Image to Wordpress Uploads directory
function tattoo_submit() {
if (isset($_POST["addtattoo"])) {
$title = "Tattoo : ". $_POST["tatooInput"];
$my_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,
View app.js
$("#freePlayerPlayBtn").on('click',function(){
kemMediaPlayer.initMedia(src,$("#freePlayerPlayBtn"),$("#freePlayerVolumeBar"),$("#freePlayerSeekeBar"),$("#freePlayerTotalDurationDisplay"),$("#freePlayerPlayedDurationDisplay"));
});
$("#fullPlayerPlayBtn").on('click',function(){
kemMediaPlayer.initMedia(src,$("#fullPlayerVolumeBar"),$("#fullPlayerVolumeBar"),$("#fullPlayerSeekeBar"),$("#fullPlayerTotalDurationDisplay"),$("#fullPlayerPlayedDurationDisplay"));
});