Git常用备忘.md
引自:http://blogread.cn/it/article/6282?f=sa
配置
git config --global user.name "robbin"
git config --global user.email "[email protected]"
git config --global color.ui true
if (Meteor.is_client) { | |
var userName = "PatelNachiket"; | |
Template.hello.greeting = function () { | |
return "Fetch recent tweets from Twitter stream of user : " ; | |
}; | |
Template.hello.events = { | |
'click #fetchButton' : function () { | |
console.log("Recent tweets from stream!"); | |
$('#fetchButton').attr('disabled','true').val('loading...'); |
Git常用备忘.md
引自:http://blogread.cn/it/article/6282?f=sa
配置
git config --global user.name "robbin"
git config --global user.email "[email protected]"
git config --global color.ui true
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
<?php | |
$fileName = $_FILES['afile']['name']; | |
$fileType = $_FILES['afile']['type']; | |
$fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
$json = json_encode(array( | |
'name' => $fileName, | |
'type' => $fileType, | |
'dataUrl' => $dataUrl, |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform | |
// specific settings file, for example, "Base File (Linux).sublime-settings". | |
// Because of this, setting them here will have no effect: you must set them | |
// in your User File Preferences. | |
"font_face": "Monaco", | |
"font_size": 12, |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.
loosely based on https://gist.github.com/bnerd/2011232
// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
// example: | |
// phantomjs getComputedStyle.js "http://www.iqiyi.com/" ".usrTxGeneral-box_hover" "position,display,visibility,overflow" | |
var TIMEOUT = 60 * 1000; | |
var webPage = require('webpage'); | |
var system = require('system'); | |
var page = webPage.create(); | |
page.settings.loadImages = false; |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
// -------------------------------------------------- | |
// Flexbox LESS mixins | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// Flexbox display | |
// flex or inline-flex | |
.flex-display(@display: flex) { | |
display: ~"-webkit-@{display}"; | |
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |