How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| string strToSplit = "splitting strings, in|multiple ways"; | |
| std::vector<std::string> words; | |
| boost::split(words, strToSplit, boost::is_any_of("\t ,|")); | |
| std::copy (words.begin(), words.end(), std::ostream_iterator<string>(cout, "\n")); | |
| words.clear(); | |
| std::istringstream iss(strToSplit); | |
| std::copy(std::istream_iterator<std::string>(iss), std::istream_iterator<std::string>(), std::back_inserter(words)); | |
| std::copy (words.begin(), words.end(), std::ostream_iterator<string>(cout, "\n")); |
| template <class T1> | |
| struct OuterStruct | |
| { | |
| T1 mValue; | |
| struct InnerStruct | |
| { | |
| T1 mValue; | |
| }; | |
| }; |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from sqlsoup import SQLSoup as sql | |
| from sys import argv | |
| DIGRAPH = """digraph structs { | |
| graph [ | |
| rankdir= "LR" | |
| bgcolor=white | |
| ] |
| SystemJS.config({ | |
| transpiler: "typescript", | |
| typescriptOptions: { | |
| "experimentalDecorators": true, | |
| "emitDecoratorMetadata": true | |
| }, | |
| map: { | |
| "rxjs": "https://npmcdn.com/rxjs", | |
| "angular2": "https://npmcdn.com/angular2", | |
| "@ngrx": "https://npmcdn.com/@ngrx", |
| # http://stackoverflow.com/questions/748324/python-convert-those-tinyurl-bit-ly-tinyurl-ow-ly-to-full-urls | |
| ############# | |
| # urllib2 | |
| import urllib2 | |
| fp = urllib2.urlopen('http://bit.ly/rgCbf') | |
| fp.geturl() | |
| # ==> 'http://webdesignledger.com/freebies/the-best-social-media-icons-all-in-one-place' |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| # @ https://cheat.readthedocs.io/en/latest/python/mock.html | |
| obj.call_count # number of times it was called | |
| obj.called == obj.call_count > 0 | |
| obj.call_args_list # a list of (args,kwargs), one for each call | |
| obj.call_args # obj.call_args_list[-1] (args,kwargs from last call) | |
| obj.return_value # set to what it should return | |
| obj.side_effect # set to an exception class or instance that should be raised when its called | |
| obj.assert_called() # doesn't work with autospec=True? just assert obj.called | |
| obj.assert_called_with(*args, **kwargs) # last call was with (*args, **kwargs) |