Posts

Showing posts from November, 2002

Can I Edit A Google Chrome Theme?

Answer : A theme is a special kind of extension that changes the way the browser looks. Themes are packaged like regular extensions, but they don't contain JavaScript or HTML code. You can download any theme and modify it by editing the manifest.json file. Colors are in RGB format. To find the strings you can use within the "colors" field, look for kColor* strings in theme_service.cc. Image resources use paths relative to the root of the extension. You can override any of the images that are specified by kThemeableImages in theme_service.cc. Just remove the "IDR_" and convert the remaining characters to lowercase. Reference: https://developer.chrome.com/extensions/themes As was mentioned, you can find it in appdata folder, e.g.: C:\Users\mizer\AppData\Local\Google\Chrome\User Data\Default\Extensions\ Hint: Sort folders by date and you can easily find the one you want :) You can find it in your appdata folders. Mine was located at: C:\Users\home\AppD

Correct Way To Return HttpResponseMessage As IActionResult In .Net Core 2.2

Answer : public class HttpResponseMessageResult : IActionResult { private readonly HttpResponseMessage _responseMessage; public HttpResponseMessageResult(HttpResponseMessage responseMessage) { _responseMessage = responseMessage; // could add throw if null } public async Task ExecuteResultAsync(ActionContext context) { var response = context.HttpContext.Response; if (_responseMessage == null) { var message = "Response message cannot be null"; throw new InvalidOperationException(message); } using (_responseMessage) { response.StatusCode = (int)_responseMessage.StatusCode; var responseFeature = context.HttpContext.Features.Get<IHttpResponseFeature>(); if (responseFeature != null) { responseFeature.ReasonPhrase = _responseMessage.ReasonPhrase; } var responseHeaders = _responseMessag

Angular / TypeScript - Call A Function After Another One Has Been Completed

Answer : So remove the setTimeout part. It will call resolve or reject and then pass the execution to the next then or catch handler. If you have some asynchronous call in the Promise, you need to call resolve/reject in the result of that call. What about not waiting 1500ms - the given time is actually the lowest time after which the function may be called. Maybe after 2000ms This is related to the main thread in which JS code works. If main thread has no work to done, then the results of the asynchronous calls are going to be executed. function f1() { return new Promise((resolve, reject) => { console.log('f1'); resolve(); }); } function f2() { console.log('f2'); } f1().then(res => f2()); If f1 is synchronous , there is nothing special to do: global() { f1(); f2(); } If f1 is asynchronous and return an Observable , use Rxjs operator , like concatMap: global() { f1().concatMap(() =>

Android - How To Access Emulator Screenshot Via Emulator?

Image
Answer : It will save in your PC . You can also specify the location of screenshots from the emulator settings . Please see the following image for reference. Emulate Volume Down + Power event to trigger Android's screenshot, then screenshot pictures will be stored at emulator's /storage/emulated/0/Pictures/Screenshots . Here is the script. Run adb shell , then copy the code below and run, you should see the emulator start taking a screenshot. cat > /data/local/tmp/screenshot.sh <<EOF #!/bin/sh echo 'volume key: down' sendevent /dev/input/event1 1 114 1 echo 'power key: down' sendevent /dev/input/event1 1 116 1 sendevent /dev/input/event1 0 0 0 sleep 1 echo 'volume key: up' sendevent /dev/input/event1 1 114 0 echo 'power key: up' sendevent /dev/input/event1 1 116 0 sendevent /dev/input/event1 0 0 0 EOF sh /data/local/tmp/screenshot.sh NOTE: My emulator's input device is "/dev/input/event1", this may be differ

Convert Existing Html.erb To Haml

Answer : You can use from the command line html2haml html2haml your_erb_file new_haml_file If you want to convert all your files in one go, look at this article : http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet There you go: http://html2haml.heroku.com/ EDIT: Moved to https://html2haml.herokuapp.com/ http://www.htmltohaml.com A more user-friendly alternative to the selected answer.

Can A Printer Print White Color?

Answer : You will not get anything on the paper with a basic CMYK inkjet or laser printer. The CMYK color mixing is subtractive , meaning that it requires the base that is being colored to have all colors (i.e., White ) So that it can create color variation through subtraction: White - Cyan - Yellow = Green White - Yellow - Magenta = Red White - Cyan - Magenta = Blue White is represented as 0 cyan, 0 yellow, 0 magenta, and 0 black - effectively, 0 ink for a printer that simply has those four cartridges. This works great when you have white media, as "printing no ink" simply leaves the white exposed, but as you can imagine, this doesn't work for non-white media. If you don't have a base color to subtract from (i.e., Black ), then it doesn't matter what you subtract from it, you still have the color Black. As others are pointing out, there are special printers which can operate in the CMYW color space, or otherwise have a white ink or toner. These can

Create Table Prosql Code Example

Example: postgres create table -- Basic table creation CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns ) );

Can Minecraft Pocket Edition Play With A Desktop Minecraft?

Answer : No, you can't. They're entirely different games. To expand a bit on BlaXpirit's answer, the PC version, the Pocket Edition, and the XBox 360 Edition are all separate games, with separate features and in separate states of development. The games are written in different languages for different platforms, and the XBox version is actually developed by a different company than Minecraft is, so it is (unfortunately) very unlikely that these versions will ever be able to join each other in online play. There are now two different versions of Minecraft on PC The java version, the original one The windows 10 version, which can play along the Pocket Editions on Android and iOS You cannot join their Java version on PC, but you surely can on the Windows 10 version. Of course, they need Windows 10 on their PC to install it It is possible to get the Windows 10 version for free if you have already existing Minecraft accounts, just go on the website in account man

Cross-browser Custom Styling For File Upload Button

Answer : I'm posting this because (to my surprise) there was no other place I could find that recommended this. There's a really easy way to do this, without restricting you to browser-defined input dimensions. Just use the <label> tag around a hidden file upload button. This allows for even more freedom in styling than the styling allowed via webkit's built-in styling [1] . The label tag was made for the exact purpose of directing any click events on it to the child inputs [2] , so using that, you won't require any JavaScript to direct the click event to the input button for you anymore. You'd to use something like the following: label.myLabel input[type="file"] { position:absolute; top: -1000px; } /***** Example custom styling *****/ .myLabel { border: 2px solid #AAA; border-radius: 4px; padding: 2px 5px; margin: 2px; background: #DDD; display: inline-block; } .myLabel:hover { background: #CCC; } .myLabel:act

Add Attribute To Class Javascript Code Example

Example 1: javascript change attribute var element = document . getElementById ( "elemId" ) ; element . setAttribute ( "attributeName" , "value" ) ; Example 2: set attribute javascript Element . setAttribute ( name , value ) ; Example 3: put new attribute on html tag using javascript // Here's what you do for the style attribute span . setAttribute ( "style" , "width:110%;float:center;left-margin:-10px;top-margin:-10;" ) ; Example 4: set property dom javascrpt document . getElementsByTagName ( "H1" ) [ 0 ] . setAttribute ( "class" , "democlass" ) ;

Shell Script Echo Without Newline Code Example

Example 1: newline in echo unix echo $ 'hello\nworld' Example 2: how to print new line in shell script echo - e 'This is First Line \nThis is Second Line'