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
eclipse.preferences.version=1 | |
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | |
org.eclipse.jdt.core.compiler.compliance=1.8 | |
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | |
org.eclipse.jdt.core.compiler.processAnnotations=disabled | |
org.eclipse.jdt.core.compiler.release=disabled | |
org.eclipse.jdt.core.compiler.source=1.8 | |
org.eclipse.jdt.core.formatter.lineSplit=80 | |
org.eclipse.jdt.core.formatter.comment.line_length=80 | |
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80 |
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
echo "33:34" | awk -F':' '{ print $1, $2 }' | read a b <<< (cat) | |
read c d <<< $(echo "21:22" | awk -F':' '{ print $1, $2 }') |
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 s = process.argv[2]; | |
const searchString = (string, pattern) => | |
string | |
.match(new RegExp(pattern.source, pattern.flags)) | |
.map(match => new RegExp(pattern.source, pattern.flags).exec(match)); | |
console.log( | |
searchString(s, /require\(\'(.*)'\)/gi) | |
.map(([_, r]) => r) | |
.join(' '), |
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
sudo apt-get update | |
sudo apt-get clean | |
sudo apt-get autoremove | |
sudo apt-get update && sudo apt-get upgrade | |
sudo dpkg --configure -a | |
sudo apt-get install -f |
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
/* | |
{ | |
name, | |
tags: [{ | |
name, | |
subtags: [{ | |
name | |
}] | |
}] | |
} |
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 <fstream> | |
using namespace std; | |
template <typename T> | |
class Vector { | |
private: | |
T* data; | |
int _size; |
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 data = { user: { address: { street: "my street" } } }; | |
const data2 = { user: {} }; | |
const proxy = obj => new Proxy(obj, { get }); | |
const get = (t, p) => | |
t && t[p] && (typeof t[p] === "object") ? proxy(t[p]) : t[p] ? t[p] : ""; | |
const safe = obj => proxy(obj); | |
var out = safe(data).user.address.street; | |
var out2 = safe(data2).user.address.street; | |
console.log(out); // my street |
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 { promisify } = require("util"); | |
const { resolve } = require("path"); | |
const fs = require("fs"); | |
const readdir = promisify(fs.readdir); | |
const rename = promisify(fs.rename); | |
const stat = promisify(fs.stat); | |
const readfile = promisify(fs.readFile); | |
async function getFiles(dir) { | |
const subdirs = await readdir(dir); |
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 swap = (arr, id, id2) => { | |
const left = { [id2]: arr[id] }; | |
const right = { [id]: arr[id2] }; | |
return Object.assign([...arr], left, right); | |
} |