Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Partial reset



  CSS Tools: Reset CSS

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. The general reasoning behind this was discussed in a May 2007 post, if you're interested. Reset styles quite often appear in CSS frameworks, and the original "meyerweb reset" found its way into Blueprint, among others. The reset styles given here are intentionally very generic. There isn't any default color or background set for the bod...

   CSS,Cross browser compatibility,Reset,Partial reset     2011-12-05 02:44:11

  git reset vs git revert

When maintaining code using version control systems such as git, it is unavoidable that we need to rollback some wrong commits either due to bugs or temp code revert. In this case, rookie developers would be very nervous because they may get lost on what they should do to rollback their changes without affecting others, but to veteran developers, this is their routine work and they can show you different ways of doing that. In this post, we will introduce two major ones used frequently by develo...

   GIT,GIT RESET,GIT REVERT     2019-02-02 08:26:39

  Scala, Patterns and The Perl Effect

He tried to understand that one concept for a couple of months before it made sense to him. Admittedly, partial functions are not intuitive for anyone who has been schooled in traditional programming, but still, looking at the problem he was trying to solve it seemed like James was required to expend too much effort relative to the simplicity of the problem (as he pointed out, now that he understands the concept it seems straightforward). He showed me the code, and it was basically a situa...

   Scala,Perl,Pattern,Partial function,Template     2011-12-21 09:25:41

  How to undo git changes?

When using git for version control, there is frequent need on undoing commits due to some unexpected changes. This post will introduce how to undo changes with git command in different cases. Undo commit A common undo case is that some commit needs to be reverted as the commit contains error. In this case, the code is already committed. The command to revert the commit is git revert HEAD This command will add new a commit to the existing head to undo the previous commit. It will not change the p...

   GIT,GIT RESET,GIT REVERT,GIT CHECKOUT     2019-12-28 02:21:47

  New function signal.NotifyContext in GoLang 1.16

os/signal package in GoLang may not be frequently used but it provides some good features like Shutdown() which can be used to gracefully shutdown a running HTTP server. func (srv *Server) Shutdown(ctx context.Context) error With this function, there is no need to use third party library to gracefully shutdown HTTP server. How is it being used? package main import ( "context" "fmt" "net/http" "os" "os/signal" "time" ) func main() { server := http.Server{ Addr: ":8080", } http.Handl...

   GOLANG,NOTIFYCONTEXT,GRACEFUL SHUTDOWN     2021-06-19 01:07:10

  Ways to undo wrong Git operations

While using Git to version code, programmers would inevitably perform some invalid operations which are not expected. Sometimes it's difficult to deal with this kind of awkward situations. If the programmer chooses to undo the operation, the programmer needs to bear the risk of deleting something which is not supposed to be deleted if the undo is done improperly. If the programmer leaves it as is, the file needs to be updated again manually with a new commit. In this post, we will try to pr...

   GIT,GIT COMMIT,GIT RESET     2018-07-07 03:28:21

  JavaScript's New Features: Exploring the Latest Additions to the Language

As the web continues to evolve, so too does the JavaScript ecosystem. With the release of ECMAScript 2023 (ES2023), JavaScript developers can now leverage a range of new features that promise to improve code quality, readability, and maintainability. In this blog post, we'll dive into some of ES2023's most exciting additions and provide practical examples of how they can be used in your projects. 1. Private Fields and Methods in Classes One of the most anticipated features in ES2023 is the intro...

   JAVASCRIPT,ES2023     2023-04-16 01:41:58

  ByteBuffer in Java

ByteBuffer is introduced in java.nio since Java 1.4. It provides a way of representing raw structured data such as from a file or from network. It enables fast access of underlying data compared to traditional ways like byte[] Prior to Java 1.4, if you want to represent a structured raw data, you need to create a byte[] and then having a set of checks to delimit the byte array to get the expected tokens. There are three ways to create a ByteBuffer: Wrapping an exiting array by calling ByteBuffe...

   JAVA,BYTEBUFFER,ALLOCATION     2015-07-08 03:17:44

  Frequently used Git commands

Git configuration git config --global user.name "robbin" git config --global user.email "fankai@gmail.com" git config --global color.ui true git config --global alias.co checkout git config --global alias.ci commit git config --global alias.st status git config --global alias.br branch git config --global core.editor "mate -w" # Configure Editor to use textmate git config -l #List all configurations User's git configuration file : ~/.gitconfig Frequently used Git commands Check、add...

   Git,Command     2013-03-11 19:41:06

  Output a file with HTTP range header in PHP

When downloading a large file, we may encounter some network issues which causes download termination and only part of the file is downloaded. When the network connection resumes next time, we may need to redownload the file again from the beginning. In order to save bandwidth, http provides a Range parameter in its header which can control the file transfer flow. With the range parameter in the header, we can resume the download from where we stop. Here is a piece of PHP code snippet which uses...

   PHP, range,http, file transfer     2013-01-09 05:55:05