start new:
tmux
start new with session name:
tmux new -s myname
| # total lines removed | |
| git log --numstat --pretty="" | grep -v lock | sed -r -e "s/^([0-9]+)\\s+([0-9]+).*/\2/" | grep -v "^-" | paste -sd+ | bc | |
| # total lines added | |
| git log --numstat --pretty="" | grep -v lock | sed -r -e "s/^([0-9]+)\\s+([0-9]+).*/\2/" | grep -v "^-" | paste -sd+ | bc | |
| # the main thing to edit would be git log. You could change this to whatever author you like or over | |
| # whatever time frame or between two commits, etc. The `grep -v lock` removes all files like yarn.lock | |
| # or package-lock.json, which is the main reason I created this command, because those files added like 40,000 | |
| # line changes to my code. Also the `grep -v "^-"`removes `png` files and such that are not countedl |
| const express = require('express') | |
| const http = require('http') | |
| const Gun = require('gun') | |
| const app = express() | |
| const server = http.createServer(app) | |
| Gun({file: 'data.json', web: app}) | |
| app.use(Gun.serve) | |
| app.get('/', function (req, res) { |
| import React, { Component } from 'react' | |
| import { render } from 'react-dom' | |
| import Gun from 'gun' | |
| const gun = Gun().get('todos') | |
| const formatTodos = todos => Object.keys(todos) | |
| .map(key => ({ key, val: todos[key] })) | |
| .filter(t => Boolean(t.val) && t.key !== '_') | |
| class Todos extends Component { |
| // price = price * 100 for simplicity | |
| var str = '' | |
| for (let price = 1; price <= 400; price++) { | |
| let gallons = 1 | |
| while (gallons*price % 100 !== 0) | |
| gallons++ | |
| str+=format(price, gallons, gallons*price) | |
| } | |
| function format(gasPrice, totalGallons, totalPrice) { | |
| return padRight(`Gas Price: ${currency(gasPrice)}`, ' ', 22) + |
| var ul = document.getElementsByClassName('thumbs')[0] | |
| var toDelete = [] | |
| for (var i = 0; i < ul.children.length; i++) { | |
| var releaseDate = ul.children[i].getElementsByClassName('now-thumbnail')[0].getAttribute('data-releasedate') | |
| if (+releaseDate < 2000) toDelete.push(ul.children[i]) | |
| } | |
| toDelete.forEach(function (el) {el.parentNode.removeChild(el)}) | |
| for (var i = ul.children.length; i >= 0; i--) { | |
| ul.appendChild(ul.children[Math.random() * i | 0]); | |
| } |
| port module Training exposing (..) | |
| import Html exposing (..) | |
| import Html.App exposing (programWithFlags) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (..) | |
| import Html.Keyed as Keyed | |
| import Html.Lazy exposing (lazy, lazy2) | |
| import Json.Decode as Json | |
| import String |
| const sim = require('./simulation') | |
| const humans = require('humans') | |
| describe('#aiTest', function() { | |
| beforeEach(function() { | |
| humans.restore() | |
| sim.restore() | |
| }) | |
| it('should not kill all humans', function() { |
| var noteMappings = { | |
| c: 16.35, | |
| 'c#': 17.32, | |
| d: 18.35, | |
| 'd#': 19.45, | |
| e: 20.6, | |
| f: 21.83, | |
| 'f#': 23.12, | |
| g: 24.5, | |
| 'g#': 25.96, |
| var ul = document.getElementsByClassName('thumbs')[0] | |
| var toDelete = [] | |
| for (var i = 0; i < ul.children.length; i++) { | |
| var releaseDate = ul.children[i].getElementsByClassName('now-thumbnail')[0].getAttribute('data-releasedate') | |
| if (+releaseDate < 2000) toDelete.push(ul.children[i]) | |
| } | |
| toDelete.forEach(function (el) {el.parentNode.removeChild(el)}) |