This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mysql' | |
module Piwik | |
#--------------query for piwik database for getting token of user----------- | |
def piwik_tokens | |
!connection_piwik.nil? ? @rs = connection_piwik.query('select login, token_auth from enbake_piwik_user;') : "#{["Connect-Piwik-Sever"]}" | |
!@rs.nil? ? result : ["Connect-Piwik-Sever"] | |
end | |
#--------------------query for site_ids for clients dashboard---------------- | |
def piwik_site_ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("input",".upload", function(){ | |
var src = $(this).val(); | |
src = src.replace("watch?v=", "v/"); | |
src = src.replace("video/", "embed/video/"); | |
var abc="<iframe src='my_source' width='452' height='345' scrolling='no' frameborder='no' target='_top' allowFullScreen></iframe>".replace(/my_source/g,src); | |
if (src.match(/(youtube|youtu|vimeo|veoh|dailymotion|kickstarter|metacafe)\.(com|be)\/((watch\?v=([-\w]+))|(video\/([-\w]+))|(projects\/([-\w]+)\/([-\w]+))|([-\w]+))/)) { | |
$(this).next('#thumbs').empty().append(abc); | |
} | |
else if( src.match(/^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.mp4|.MP4|.avi|.AVI|.3gp|.3GP)$/)) { | |
$(this).next('#thumbs').empty().append(abc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sendMessage = function(file) { | |
client.publish(channel, { file: file }); | |
} | |
var fr = new FileReader(); | |
fr.onload = function(event) { | |
sendMessage(event.target.result); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
var app = angular.module('app', ['ngRoute', 'ngStorage', 'ui.bootstrap.modal', 'autocomplete', 'timer', 'satellizer']); | |
app.config(function ($authProvider) { | |
$authProvider.google({ | |
//clientId: 'xxxxxxxxxxxxxxxxx.apps.googleusercontent.com' //development | |
clientId: 'xcccccccccccccccccxxxxxx.apps.googleusercontent.com' //production | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container" ng-controller="adminUserCtrl as employee" style="margin-top:30px"> | |
<div class="col-md-10 col-md-offset-1"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"><h3 class="panel-title"><strong>Add Employee </strong></h3> | |
<div style="float:right; font-size: 80%; position: relative; top:-10px"><a href="#">All employee</a> | |
</div> | |
</div> | |
<div class="panel-body"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crontab -l #list all cronjob using this command | |
crontab -r #To remove all cronjob which are listed. | |
crontab -e #which will allow you to edit the crontab file, deleting or commenting out the offending line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if you have problem relate picking date on pop-up modal of bootstrap in AngularJs aplication. | |
#Then it mean you have Time-zone problem to solve this proble for all time-zone just add a custom time zone to your time zone | |
then it will work same for every time zone. | |
i.e: | |
var date = '12/02/2016' , + " 12:00:00 UTC" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
#system('ls -la') #=> outputs the output of that command | |
#system('skype') #open skype using system command. | |
#http://www.dreamsyssoft.com/ruby-scripting-tutorial/loops-tutorial.php | |
require 'optparse' | |
options = {:name => nil, :age => nil} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#To run this script in terminal first to install this dependancy: sudo apt-get install xdotool | |
#To make it excutable GoTo the file directory and run the command: chmod u+x upwork_tracker_free_time.rb | |
#Now you just need to run this file using form termial :~ ./upwork_tracker_free_time.rb | |
#Note: You need to specifiy every on which work space you want to swicth tab currently In code I am only swithching termial | |
#But you can also switch browser tab or sublim tabs subprocess.call("xdotool key ctrl+Tab" ,shell=True) | |
#Enjoy :) | |
import subprocess | |
import time | |
subprocess.call("xdotool key ctrl+alt+Up" ,shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm --cached -r app/bower_components/* |
OlderNewer