background preloader

Learn Vim Progressively - Vimperator

Learn Vim Progressively - Vimperator
tl;dr: You want to teach yourself vim (the best text editor known to human kind) in the fastest way possible. This is my way of doing it. You start by learning the minimal to survive, then you integrate all the tricks slowly. Vim the Six Billion Dollar editor Better, Stronger, Faster. Learn vim and it will be your last text editor. I suggest you teach yourself Vim in 4 steps: SurviveFeel comfortableFeel Better, Stronger, FasterUse superpowers of vim By the end of this journey, you’ll become a vim superstar. But before we start, just a warning. 1st Level – Survive Install vimLaunch vimDO NOTHING! In a standard editor, typing on the keyboard is enough to write something and see it on the screen. You should feel a bit better. You now know how to switch between Insert and Normal mode. i → Insert mode. Only 5 commands. But first, just a little remark about Normal mode. A last word about notations: instead of writing Ctrl-λ, I’ll write <C-λ>.commands starting with : end with <enter>. Better Stronger

Learn Vimscript the Hard Way - Vimperator Shuffling Shuffling is a very interesting programming problem, Almost everybody can come up with a good algorithm using a simple rand() function, but it gets a little tricky when one has to perform a in place shuffle (i.e. w/o using any extra memory). Knuth's Algorithm described in the Art of Computer programming, Vol 2 (which is based on Fisher Yates algorithm) is regarded as one the best known algorithm for the problem. The description on wikipedia is a little clearer and goes like this:1. Let A1 := 1, A2 := 2 and so on up to AN := N, and let n := N.2. Pick a random number k between 1 and n inclusive.3. If k ≠ n, swap the values of Ak and An.4. Alternately, instead of going n to 1 we can do a forward pass like here: int N = array.length; for (int i = 0; i < N; i++) { int r = i + (int) (Math.random() * (N-i)); int t = array[r]; array[r] = array[i]; array[i] = t; } To turn the Java example above into an example of Sattolo's algorithm, simply replace rng.nextInt(n) with rng.nextInt(n-1) in the code.

mysql - Can HTML be embedded inside PHP "if" statement Password Safe Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin - Vimperator This article is part of the ongoing Vi / Vim Tips and Tricks Series. As a programmer, you may do lot of repetitive tasks while coding such as: Adding file header Adding function/frame comment Including default code snippet Performing syntax check Reading documentation about a function Converting a code block to comment, and vice versa The C-Support Vim Plugin offers easiest way to do all of the above, saving lot of time and keystrokes for C and C++ programmers. The plugin was written by Fritz Mehner, who explains the purpose of the plugin as: “Write and run programs. Statement oriented editing of C / C++ programs Speed up writing new code considerably. This article explains how to install the plugin in 3 easy steps and 7 powerful features of the plugin. 3 Steps to Install the C.Vim Plugin Step 1: Download C Vim Plugin Download the plugin from website. $ cd /usr/src $ wget Step 2: Install the C Vim Plugin $ vim ~/.vimrc filetype plugin on

ATVBackup - atv-bootloader - Apple TV bootloader Note: This requires "recovery-0.6.tar.gz" or greater. The previous versions do not contain all the required command-line tools. You have bought an AppleTV and want to alter the original internal PATA disk. What we do is take advantage of the self-restoring capability that is already built into the AppleTV EFI fireware. Warning You might use "dd" to copy the entire disk but that's a waste of time and storage space and "dd" is not the correct tool to copy GPT format disks. Let's get started, first build atv-bootloader on a USB pen disk with telnet support. This is the USB flash drive created in atv-bootloader on a USB pen disk parted -s /dev/sdb unit s print Model: SanDisk Cruzer Micro (scsi)Disk /dev/sdb: 501759sSector size (logical/physical): 512B/512BPartition Table: gpt Number Start End Size File system Name Flags 1 40s 69671s 69632s hfs+ primary atvrecv Add the ext3 partition The ending sector is the max sectors - 34 sectors (501759s - 34s = 501725s) mkdir src dst mkdir tmp mkdir staging <?

Clearing a float container without source markup (This clearing technique was developed by Tony Aslett, of The earliest known mention of the basic :after idea is found here.) Notice as of March 4th, 2008: The article you are reading is getting a bit old and much new information on the subject of clearing has appeared since it was written. Clearing Floats The Old Fashioned Way When a float is contained within a container box that has a visible border or background, that float does not automatically force the container's bottom edge down as the float is made taller. This float-enclosing behavior in IE can also be 'toggled' off again just by hovering of links within the container, if that hovering alters either the link background or one of several other CSS properties. The W3C suggests placing a "cleared" element last in the container box, which is then recognized by the container height, forcing the container to enclose the float above that cleared element too. <div><! Problems With The Method Using :after Toggle Trouble

PDF To WORD Converter - Freeware gmarik/vundle · GitHub - Vimperator LinuxUSBPenBoot - atv-bootloader - Apple TV bootloader In this guide, we will build an atv-bootloader based USB flash disk that can be used for standalone boot. We will also enable telnet so we don't need a USB keyboard attached and can do everything remotely using a telnet session using a wired network connection. Unfortunately, wireless is not supported at this time. Since atv-bootloader contains all the disk tools required for creating GPT formatted partitions, one can use it to boot, partition and install Linux with a USB cdrom using only the AppleTV. We need our standard items for creating an AppleTV "Recovery" partition. parted --version parted (GNU parted) 1.8.8Copyright (C) 2007 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later < is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Written by < Verify that it looks fine and the atvrecv flag is set

PHP for Beginners: Building Your First Simple CMS The Magic of PHP + MySQL It’s safe to say that nearly every website that’s up-to-date these days is using some form of content management system (CMS). While there are a ton of great free options that provide us with a CMS to power a website (WordPress, Drupal, etc.), it doesn’t hurt to peek under the hood and get a feel for how these systems work. To get our feet wet as back-end developers, we’ll be creating a simple PHP class that will: Create a databaseConnect to a databaseDisplay a form with two fieldsSave the form data in the databaseDisplay the saved data from the database Download Files This class is intended to give you a feel for how PHP and MySQL interact together, and to show the basics of a CMS. Building the Class Our first step is to simply lay out the class in a file named ‘simpleCMS.php’ so we have a road map to work with. As you can see, we’re creating one class with four variables and five methods. The Variables Build the Database Connect to the Database Build the Form <! <?