git update-index --assume-unchanged path/to/file
git update-index --no-assume-unchanged path/to/file
git ls-files -v | grep '^[[:lower:]]'
num=10 | |
# -eq equals | |
# -ne not equal | |
# -gt greather than | |
# -ge greather than or equal | |
# -lt less than | |
# -le less than or equal | |
if [ $num -eq 10] |
git update-index --assume-unchanged path/to/file
git update-index --no-assume-unchanged path/to/file
git ls-files -v | grep '^[[:lower:]]'
/** | |
<template> | |
<div id="foo" @click="handleClick">Yo!</div> | |
</template> | |
*/ | |
import { | |
createElementVNode as _createElementVNode, | |
openBlock as _openBlock, | |
createElementBlock as _createElementBlock, |
/* | |
* @desc closure in loops | |
*/ | |
// the problem here, is we're thinking we're getting | |
// a new 'i' for each iteration, so at the end it only | |
// prints 6, because 'i' is 6 at the end of the loop and | |
// the timers runs after so it'll print 6. | |
for (var i = 0; i <= 5; i += 1) { | |
setTimeout(function () { |
// getScope() is a method provided by jscodeshift that can be used to get the Scope object for a given Node. | |
// A Scope object represents the lexical scope of a node in the abstract syntax tree (AST). | |
// It contains information about the variables, functions, and other declarations that are in scope at a given point in the code. | |
// Here's an example of how getScope() can be used: | |
import { getScope } from 'jscodeshift'; | |
const source = ` | |
function foo() { |
struct Point<T, U> { | |
x: T, | |
y: U, | |
} | |
impl<T, U> Point<T, U> { | |
// Methods that use different generic types than their struct’s definition | |
fn mixup<V, W>(self, other: Point<V, W>) -> Point<T, W> { | |
Point { | |
x: self.x, |
// represents the `possible` absence of a value | |
enum Option<T> { | |
Some(T), | |
None, | |
} | |
let email: Option<String> = Some(email_str); | |
let email: Option<String> = None; | |
// representsan operation that could have failed |
function upper(arr: string[]) { | |
for (let i = 0; i < arr.length; i += 1) { | |
let str = arr[i]; | |
console.log(str.upperCase()) | |
} | |
} | |
upper(['foo', 'bar', 'baz']); | |
// In Typescript when index into an array you get the element type of the array. |
#!/usr/bin/env sh | |
# checks to see if running | |
launchctl list | grep mongo | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
launchctl remove homebrew.mxcl.mongodb | |
pkill -f mongod |
function replaceRange(str: string, start: number, end: number, substitute: string): string { | |
const chunk = substitute.repeat(end - start); | |
return `${str.substring(0, start)${chunk}${str.substring(end)}`; | |
} |