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
const fs = require('fs'), | |
path = require('path'), | |
dir = '~/Downloads', | |
match = /.*_(\w+\.part\d+.rar)/ // change this to whatever pattern needed | |
files = fs.readdirSync(dir) | |
files.filter(f => f.match(match)).forEach(f => { | |
const fpath = path.join(dir, f), | |
newfpath = path.join(dir, f.replace(match, (m, p1) => p1)) | |
fs.renameSync(fpath, newfpath) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/trusty64" | |
# Create a forwarded port mapping which allows access to a specific port | |
# within the machine from a port on the host machine. In the example below, | |
# accessing "localhost:8080" will access port 80 on the guest machine. | |
# config.vm.network "forwarded_port", guest: 80, host: 8080 |
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
<ul> | |
<li ngRepeat="exercise in exercises | orderBy: exerciseOrder"> | |
{{exercise.title}} | |
</li> | |
</ul> |
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
class Graph(val V: Int) { | |
private var e = 0; | |
private val adj = Array.fill[Double](V * V)(0) | |
def E = e; | |
def apply(x: Int) = for (y <- 0 until V if isAdjacent(x, y)) yield y | |
def apply(x: Int, y: Int) = adj(indexFor(x, y)) |
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
import java.util.Scanner; | |
public class Rectangle { | |
public static class Point { | |
public final float x, y; | |
public final static Point ORIGIN = new Point(0, 0); | |
public Point(float x, float y) { |
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
#include <iostream> | |
#include <string> | |
#include <queue> | |
using namespace std; | |
class MapADT { | |
public: | |
MapADT(); | |
MapADT(string filename); |