This file contains hidden or 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 {Injectable} from '@angular/core'; | |
| import {DateAdapter} from '@angular/material'; | |
| import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns'; | |
| // CONFIG. Use environment or something for a dynamic locale and settings | |
| import {es as locale} from 'date-fns/locale'; | |
| const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday... | |
| export const MAT_DATE_FNS_DATE_FORMATS = { |
This file contains hidden or 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
| <html lang="en-GB"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <body> | |
| <div id="gradient"></div> | |
| <div id="page"> | |
| <div id="Message-Container"> | |
| <div id="message"> | |
| <h1>Congratulations!</h1> | |
| <p>You are done.</p> |
This file contains hidden or 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 { join } = require('path'); | |
| const { readdirSync, renameSync } = require('fs'); | |
| const [dir, search, replace] = process.argv.slice(2); | |
| const match = RegExp(search, 'g'); | |
| const files = readdirSync(dir); | |
| files | |
| .filter(file => file.match(match)) | |
| .forEach(file => { | |
| const filePath = join(dir, file); |
This file contains hidden or 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
| # overwrite master with contents of seotweaks branch (seotweaks > master) | |
| git checkout seotweaks # source name | |
| git merge -s ours master # target name | |
| git checkout master # target name | |
| git merge seotweaks # source name |
This file contains hidden or 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
| let array = [5, 7, 4, -3, 9, 1, 10, 4, 5, 8, 9, 3] | |
| function findLongestIncreasingSubsequence(x) { | |
| let maxArray = new Array(x).fill(1) | |
| let max = 1 | |
| for (let i = 1; i < x; i++) { | |
| for (let j = 0; j < i; j++) { | |
| if (array[j] < array[i] && maxArray[i] <= maxArray[j]) { | |
| maxArray[i] += 1 | |
| if (maxArray[i] > max) { |
This file contains hidden or 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
| let X = ['B', 'C', 'D', 'B', 'C', 'D', 'A'] | |
| let Y = ['A', 'B', 'E', 'C', 'B', 'A', 'B'] | |
| function L(x,y) { | |
| let matrix = new Array(x.length + 1).fill(new Array(y.length + 1).fill(0)) | |
| let max = 0 | |
| for (let i = 1; i < matrix.length; i++) { | |
| for (let j = 1; j < matrix[i].length; j++) { | |
| if (x[i-1] === y[j-1]) { | |
| matrix[i][j] = matrix[i-1][j-1] + 1 |
This file contains hidden or 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
| let S = [5, 15, -30, 10, -5, 40, 10] | |
| function L(arr) { | |
| let table = new Array(arr.length) | |
| table[0] = arr[0] | |
| let max | |
| let sum = arr[0] | |
| for (let i = 1; i < arr.length; i++) { | |
| if (sum + arr[i] > arr[i]) { | |
| table[i] = sum + arr[i] |
This file contains hidden or 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
| Description: fix incorrect function parsing | |
| Author: Chet Ramey <[email protected]> | |
| Index: bash-4.2/bash/builtins/common.h | |
| =================================================================== | |
| --- bash-4.2.orig/bash/builtins/common.h 2010-05-30 18:31:51.000000000 -0400 | |
| +++ bash-4.2/bash/builtins/common.h 2014-09-22 15:30:40.372413446 -0400 | |
| @@ -35,6 +35,8 @@ | |
| #define SEVAL_NOLONGJMP 0x040 | |
This file contains hidden or 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
| (ql:quickload :cl-ppcre) | |
| (ql:quickload :rutils) | |
| (use-package :rutil) | |
| (named-readtables:in-readtable rutils-readtable) | |
| (defpar *orig* | |
| #/I joined Hacker News around 5 years ago. I used to wake up and do the grim commute each morning to London from my home and the only thing that made it vaguely ok was Hacker News. It was a great place to go and find interesting articles from genuinely passionate people. It also used to be a really safe place to launch a startup that you'd spent days, weeks, years on - your project. It was a place where you could launch your startup and know you'd get great constructive feedback. People may not necessarily like your site but they'd admire you for having the balls to launch it, for spending time developing something that you hoped could benefit people in some way. They'd want you to succeed and they'd try and help you succeed with feedback that would ultimately help you. Unfortunately, today's Hacker News audience is no longer the same. Today's Hacker News is a place where us |
This file contains hidden or 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
| use std::collections::HashMap; | |
| use std::collections::hash_map::Entry; | |
| use std::cmp::Eq; | |
| #[derive(Debug)] | |
| pub struct RawKV { | |
| key: String, | |
| value: String | |
| } |