Posts

Copy / Paste Text Selections Between Tmux And The Clipboard

Answer : Use the following tmux.conf with copy-pipe in the new versions of tmux (1.8+): set -g mouse on # To copy: bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c " # To paste: bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer" prefix+[ into copy-mode select content with mouse(hold) M-w to copy that part into system clipboard C-y the paste it inside tmux, C-v to paste it inside other regular application like web browser. Please note that, with Tmux 2.4 (since this commit), the binding syntax has changed. I paraphrase this Github comment to summarise the change briefly: replace -t with -T replace vi-<name> with <name>-mode-vi prefix the command with send-keys -X I had: bind-key -n -t vi-copy Enter copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' bind-key -n -t vi-copy MouseDragEnd1Pane copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' which I needed to change to: bind-key -n -T ...

Css Rotate Animation Infinite Code Example

Example 1: how rotate infinity css @-webkit-keyframes rotating /* Safari and Chrome */ { from { -webkit-transform : rotate ( 0 deg ) ; -o-transform : rotate ( 0 deg ) ; transform : rotate ( 0 deg ) ; } to { -webkit-transform : rotate ( 360 deg ) ; -o-transform : rotate ( 360 deg ) ; transform : rotate ( 360 deg ) ; } } @keyframes rotating { from { -ms-transform : rotate ( 0 deg ) ; -moz-transform : rotate ( 0 deg ) ; -webkit-transform : rotate ( 0 deg ) ; -o-transform : rotate ( 0 deg ) ; transform : rotate ( 0 deg ) ; } to { -ms-transform : rotate ( 360 deg ) ; -moz-transform : rotate ( 360 deg ) ; -webkit-transform : rotate ( 360 deg ) ; -o-transform : rotate ( 360 deg ) ; transform : rotate ( 360 deg ) ; } } .rotating { -webkit-animation : rotating 2 s linear infinite ; -moz-animation : rotating 2 s linear infinite ; -ms-animation : rotating 2 s linear infinite ; ...

The Return 0 Statement In Main Function Indicate Code Example

Example: return 0; c++ // This example gives a reason why you should use using namespace std # include <iostream> using namespace std ; cout << "Hello " << endl ; /* this one is shorter*/ // without the using namespace std you will need to use this std :: cout << "Hello" << std :: cout << endl /* this one is longer and it requires shorter amount of time */

How To Concatenate Strings In Google Sheets Code Example

Example 1: google spreadsheets add two strings CONCAT ( "String1" , "String2" ) //or CONCATENATE ( "String1" , "String2" , "String3" ) //CONCATENATE allows more than 2 strings. Example 2: google sheets concatenate CONCATENATE ( "Welcome" , " " , "to" , " " , "Sheets!" ) CONCATENATE ( A1 , A2 , A3 ) CONCATENATE ( A2 : B7 )

Flexbox Vertical Align Center Code Example

Example 1: css flex vertical align /* Answer to: "css flex vertical align" */ .box { display : flex ; align-items : center ; /* Vertical */ justify-content : center ; /* Horizontal */ } .box div { width : 100 px ; height : 100 px ; } /* For more information go to: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Aligning_Items_in_a_Flex_Container */ Example 2: flexbox align center vertically .Aligner { display : flex ; align-items : center ; justify-content : center ; } .Aligner-item { max-width : 50 % ; } .Aligner-item--top { align-self : flex-start ; } .Aligner-item--bottom { align-self : flex-end ; } Example 3: flex align top css align-items: flex-start | flex-end | center | baseline | stretch .container { display : flex ; align-items : flex-start ; } Example 4: css vertical align with flexbox <div class= "align-vertically" > I am vertically centered! </div> /*Css */ .a...

Access IP Camera In Python OpenCV

Image
Answer : An IP camera can be accessed in opencv by providing the streaming URL of the camera in the constructor of cv2.VideoCapture . Usually, RTSP or HTTP protocol is used by the camera to stream video. An example of IP camera streaming URL is as follows: rtsp://192.168.1.64/1 It can be opened with OpenCV like this: capture = cv2.VideoCapture('rtsp://192.168.1.64/1') Most of the IP cameras have a username and password to access the video. In such case, the credentials have to be provided in the streaming URL as follows: capture = cv2.VideoCapture('rtsp://username:password@192.168.1.64/1') This works with my IP camera: import cv2 #print("Before URL") cap = cv2.VideoCapture('rtsp://admin:123456@192.168.1.216/H264?ch=1&subtype=0') #print("After URL") while True: #print('About to start the Read command') ret, frame = cap.read() #print('About to show frame of Video.') cv2.imshow("C...

Show 3 Dots Css Code Example

Example: three dots in css span { display : inline-block ; width : 180 px ; white-space : nowrap ; overflow : hidden !important ; text-overflow : ellipsis ; }

Bootstrap Wysihtml5 Set Value Not Working

Answer : You should be able to achieve the same using below $("#<%=txtDescrizioneBreveCategoria.ClientID%>").wysihtml5(); window.describeEditor = window.editor; And then later you should can use describeEditor.setValue(c.DescrizioneBreve, true) or use editorDescrizioneBreve.data("wysihtml5").editor.setValue(c.DescrizioneBreve, true); Where editorDescrizioneBreve is the object returned by $("#<%=txtDescrizioneBreveCategoria.ClientID%>").wysihtml5() PS: Solution based on https://github.com/jhollingworth/bootstrap-wysihtml5/issues/52 For me, this worked: $('.wysihtml5-sandbox').contents().find('body').html(descr) I have only one Wysihtml5 on my page, with multiple, you need to use more precise selector.

Custom Checkbox Bootstrap Code Example

Example 1: bootstrap checkbox <div> <div class= "row" > <div class= "form-check form-check-inline" > <input id= "checkbox2" type= "checkbox" > <label for= "checkbox2" >Checkbox not checked</label> </div> <div class= "form-check form-check-inline" > <input id= "checkbox3" type= "checkbox" checked= "checked" > <label for= "checkbox3" >Checkbox checked</label> </div> </div> </div> Example 2: bootstrap checkbox <!-- Checkbox & Label --> <div class= "form-check" > <input class= "form-check-input" type= "checkbox" value= "" id= "flexCheckDefault" > <label class= "form-check-label" for= "flexCheckDefault" > I want to receive news and updates about this produc...

C Program To Generate Random Numbers Without Using Rand Code Example

Example 1: how to genrate a random number in C # include <time.h> # include <stdlib.h> srand ( time ( NULL ) ) ; // Initialization, should only be called once. int r = rand ( ) ; // Returns a pseudo-random integer between 0 and RAND_MAX. Example 2: how to genrate a random number in C srand ( time ( NULL ) ) ; int r = rand ( ) ;

Dropdown Button In Bootstrap 4 Code Example

Example 1: create a dropdown in html bootstrap <div class= "dropdown" > <button class= "btn btn-secondary dropdown-toggle" type= "button" id= "dropdownMenu2" data-toggle= "dropdown" aria-haspopup= "true" aria-expanded= "false" > Dropdown </button> <div class= "dropdown-menu" aria-labelledby= "dropdownMenu2" > <button class= "dropdown-item" type= "button" >Action</button> <button class= "dropdown-item" type= "button" >Another action</button> <button class= "dropdown-item" type= "button" >Something else here</button> </div> </div> Example 2: bootstrap 4 dropdown <div class= "dropdown" > <button class= "btn btn-secondary dropdown-toggle" type= "button" id= "dropdownMenuButton" data-...

Pypi Tkinter Code Example

Example: python tkinter import tkinter as tk obj = tk . Tk ( ) # Creates a tkinter object label = tk . Label ( obj , text = "This is a text button" )

Can I Re-sign An .apk With A Different Certificate Than What It Came With?

Answer : try this 1) Change the extension of your .apk to .zip 2) Open and remove the folder META-INF 3) Change the extension to .apk 4) Use the jarsigner and zipalign with your new keystore. hope it helps If you are looking for a quick simple solution, you can use Google's apksigner command line tool which is available in revision 24.0.3 and higher. apksigner sign --ks release.jks application.apk You can find more information about apksigner tool, at the developer Android site. https://developer.android.com/studio/command-line/apksigner.html Or, alternatively, you may use an open-source apk-resigner script Open Source apk-resigner script https://github.com/onbiron/apk-resigner All you have to do is, download the script and just type: ./signapk.sh application.apk keystore key-pass alias zip -d my_application.apk META-INF/\* keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity...

Activate Windows 10 Batch Code Example

Example 1: activate win 10 batch file @echo off title Activate Windows 10 ALL versions for FREE! WireDroid.com&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software(WireDroid.com)&echo ============================================================================&echo.&echo #Supported products:&echo - Windows 10 Home&echo - Windows 10 Home N&echo - Windows 10 Home Single Language&echo - Windows 10 Home Country Specific&echo - Windows 10 Professional&echo - Windows 10 Professional N&echo - Windows 10 Education N&echo - Windows 10 Education N&echo - Windows 10 Enterprise&echo - Windows 10 Enterprise N&echo - Windows 10 Enterprise LTSB&echo - Windows 10 Enterprise LTSB N&echo.&echo.&echo ============================================================================&echo Activating your Window...

Angry Ip Scanner Mac Code Example

Example: Angry IP Scanner It's an IP Scanner to find open ports in the server and vulnerabelities

Android - Bought A New Battery, Do I Need To Calibrate It?

Answer : No Calibration of batteries (Li Ion or Li Po, used in almost all mobile devices) is a myth You can start using it straight away and charge as you normally did with earlier batteries This post will help you understand more: Looking for a consistent answer about battery calibration Using calibration apps doesn't really help as the battery files in system (to which these apps write) are renewed and previous data erased when you charge / reboot As explained in this article It [ Batterystats.bin file which stores calibration information ] has no impact on the current battery level shown to you. It has no impact on your battery life.......it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point)... Explanation in Italics mine from the same article Related Myth : Charging a new battery for X hours Charging a new battery for x hours before use is a " legacy hangover ...