If you need to restructure your commit history (squash multiple commits into one, remove commits, etc.) use the command (where N is the number of commits to include in the restructure):
git rebase -i HEAD~N
E.g.,
git rebase -i HEAD~3
package com.edatasource.receipts.parser; | |
import org.junit.Test; | |
import java.text.SimpleDateFormat; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
/** |
package com.cedarsoftware.util; | |
import java.text.DateFormatSymbols; | |
import java.text.NumberFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.Map; |
<?php | |
/* | |
Based on some other things I've seen online. | |
1: Edit the vars | |
2: Put on server somewhere accessible, e.g. your site folder as github.php | |
3: chmod +x github.php | |
4: Repo settings, add webhook to that url | |
*/ | |
$LOCAL_ROOT = "/home/username/site.com"; |
If you need to restructure your commit history (squash multiple commits into one, remove commits, etc.) use the command (where N is the number of commits to include in the restructure):
git rebase -i HEAD~N
E.g.,
git rebase -i HEAD~3
# insert from a select query | |
INSERT INTO table (column1,column2) | |
SELECT column1,column2 | |
FROM ... | |
# dropping tables | |
DROP TABLE IF EXISTS tablename; | |
'use strict' | |
var fs = require('fs') | |
var request = require('request') | |
var htmlparser = require("htmlparser2") | |
var toMarkdown = require('to-markdown').toMarkdown | |
var mkdirp = require('mkdirp') | |
if (process.argv[3] === undefined) { | |
console.log("Usage: node wikimedia-markdown-export.js [text file of all pages to export] [site domain]") |
First convert DOC
to DOCX
using LibreOffice:
/Applications/LibreOffice.app/Contents/MacOS/soffice --invisible --convert-to docx file.doc
Then convert to Markdown using pandoc:
pandoc file.docx -f docx -t markdown -o file.md
Convert to Markdown, extracting the image files:
Github Pages only supports redirects via Jekyll's ruby gem, which creates static HTML files with a <meta http-equiv="refresh"
in the <head>
.
If you run a JavaScript site that uses hash fragments (aka, site.com/#!/page
) search engines may not be able to index the content. (See noddity as a blog framework that uses hash fragments but serves static files.)
angular.module('myMod', []).controller('MyCtrl', function($scope) { | |
$scope.var = 'hello'; | |
$scope.thing = 'before'; | |
$scope.change = function(word) { | |
$scope.var = word; | |
}; | |
$scope.$watch('var', function() { | |
$scope.thing = 'after'; | |
}) | |
}); |
angular.module('eds.daysBetweenDates', []).filter('daysBetweenDates', function() { | |
return function(startDate, endDate) { | |
if (startDate && endDate) { | |
var start = moment(startDate).hour(0).minute(0).second(0).millisecond(0); | |
var end = moment(endDate).hour(0).minute(0).second(0).millisecond(0).add('day', 1); | |
return moment(end).diff(start, 'days') | |
} else { | |
return 0; | |
} | |
} |