Deleting a tree of folders using rimraf can be pretty fraught on MS Windows; the OS itself can lock files randomly, and there may be various processes getting in the way, like virus checkers or cloud file syncing apps. rimraf
itself will do an exponential-backoff-and-retry for EBUSY
and ENOTEMPTY
errors on Windows, but you can still see EPERM
and others. If you want to do exponential-backoff-and-retry for any error, see the below recipe, using node-retry.
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) (float64, int) { | |
last := 0.0 | |
z := 1.0 |
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
#!/bin/bash | |
# set this to the problem folder | |
BASE=/c/Users/ndc/Dropbox/projects/delete-me | |
cd $BASE | |
for i in `find $BASE -depth` | |
do | |
DIR=`dirname $i` | |
FILE=`basename $i` |
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
Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); | |
Response.Cache.SetValidUntilExpires(false); | |
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); | |
Response.Cache.SetCacheability(HttpCacheability.NoCache); | |
Response.Cache.SetNoStore(); |
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
{ | |
// ... | |
Competition: '', | |
Participants: [ | |
{ | |
Name: "Manchester United", | |
Players: [ | |
{ | |
Name: "Fred Fredfredfred", | |
ShortName: "Fred", |
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
// generic type: | |
public class Bag<T> {} | |
// simple usage: | |
Bag<Fruit> myBag; | |
myBag = new Bag<Fruit>(); | |
// so far so good |
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 config --global --add alias.pretty "log --oneline --abbrev-commit --branches=* --graph --decorate" |
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
<!-- | |
It's all about "forcing" with MS stuff. *Force* IIS to serve a header which will | |
*force* IE not to use it's shitty compatibility mode, even if it's an intranet | |
site and the client has "display intranet sites in compatibility view" ticked in | |
their compatibility prefs. | |
The alternative is to include the equivalent <meta http-equiv...> in your | |
markup, but that will sometimes be ignored. | |
This header is discouraged by MS for production environments. Then again, MS is |
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
n3dst4@lesster2:~/438231 (master) $ date; w | |
Sun Mar 17 17:05:27 EDT 2013 | |
17:09:52 up 4:18, 0 users, load average: 139.84, 120.85, 91.34 | |
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT |