diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f1ba3fd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +node_modules/ +test +*.log +Dockerfile* +README.md +LICENSE +style.tailwindcss + +.idea/ +.github/ +.travis.yml +.eslintignore diff --git a/Dockerfile b/Dockerfile index f9cdd8f..24a2b67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,14 @@ +# Stage 1: build the application +FROM nginx:alpine AS build +RUN rm -rf /etc/nginx/conf.d/* +COPY nginx.conf /etc/nginx/ +COPY public /usr/share/nginx/html/ +EXPOSE 80 + +# Stage 2: final image FROM alpine:latest - -# Install thttpd -RUN apk add --no-cache thttpd - -# Create a non-root user to own the files and run our server -RUN adduser -D static -USER static -WORKDIR /home/static - -# Copy the static website -# Use the .dockerignore file to control what ends up inside the image! -COPY public . - -# Run thttpd -CMD ["thttpd", "-D", "-h", "0.0.0.0", "-p", "3000", "-d", "/home/static", "-u", "static", "-l", "-", "-M", "60"] - -EXPOSE 3000 \ No newline at end of file +RUN apk add --no-cache nginx && mkdir -p /run/nginx +COPY --from=build /usr/share/nginx/html/ /usr/share/nginx/html/ +COPY --from=build /etc/nginx/nginx.conf /etc/nginx/nginx.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f038b49 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,49 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + access_log /var/log/nginx/access.log ; + error_log /var/log/nginx/error.log; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + server { + listen 80; + listen [::]:80; + + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # error_page + error_page 404 403 500 502 503 504 /assets/page/oops.htm; + + # Rename cheatsheet + rewrite ^/golang$ /go permanent; + rewrite ^/css$ /css3 permanent; + + location / { + try_files $uri $uri/ @html; + } + + location @html { + # remove .html extension + rewrite ^(.*)\.html$ $1 permanent; + try_files $uri.html $uri/ =404; + } + } +} diff --git a/source/_posts/ai.md b/source/_posts/ai.md index 7c0057c..99fe531 100644 --- a/source/_posts/ai.md +++ b/source/_posts/ai.md @@ -949,6 +949,7 @@ Getting Started ### Education assistant +- [![Favicon](https://icon.horse/icon/brain-buddy.com) Brain Buddy](https://brain-buddy.com/) - [![Favicon](https://icon.horse/icon/kobra.dev) Kobra](https://kobra.dev) - [![Favicon](https://icon.horse/icon/boldvoice.com) Boldvoice](https://boldvoice.com) - [![Favicon](https://icon.horse/icon/prepai.in/us) Prepai](https://prepai.in/us) diff --git a/source/_posts/cpp.md b/source/_posts/cpp.md index af48868..0e8132a 100644 --- a/source/_posts/cpp.md +++ b/source/_posts/cpp.md @@ -571,33 +571,161 @@ int main() { } ``` -C++ Classes & Objects +C++ Classes & Objects {.cols-2} ----------------- -### If statement +### Defining a Class ```cpp +class MyClass { + public: // Access specifier + int myNum; // Attribute (int variable) + string myString; // Attribute (string variable) +}; ``` -### If statement +### Creating an Object ```cpp +MyClass myObj; // Create an object of MyClass + +myObj.myNum = 15; // Set the value of myNum to 15 +myObj.myString = "Hello"; // Set the value of myString to "Hello" + +cout << myObj.myNum << endl; // Output 15 +cout << myObj.myString << endl; // Output "Hello" ``` -### If statement +### Constructors ```cpp +class MyClass { + public: + int myNum; + string myString; + MyClass() { // Constructor + myNum = 0; + myString = ""; + } +}; + +MyClass myObj; // Create an object of MyClass + +cout << myObj.myNum << endl; // Output 0 +cout << myObj.myString << endl; // Output "" ``` -### If statement +### Destructors ```cpp +class MyClass { + public: + int myNum; + string myString; + MyClass() { // Constructor + myNum = 0; + myString = ""; + } + ~MyClass() { // Destructor + cout << "Object destroyed." << endl; + } +}; + +MyClass myObj; // Create an object of MyClass + +// Code here... + +// Object is destroyed automatically when the program exits the scope + ``` + +### Class Methods + +```cpp +class MyClass { + public: + int myNum; + string myString; + void myMethod() { // Method/function defined inside the class + cout << "Hello World!" << endl; + } +}; + +MyClass myObj; // Create an object of MyClass +myObj.myMethod(); // Call the method +``` + + +### Access Modifiers + +```cpp +class MyClass { + public: // Public access specifier + int x; // Public attribute + private: // Private access specifier + int y; // Private attribute + protected: // Protected access specifier + int z; // Protected attribute +}; + +MyClass myObj; +myObj.x = 25; // Allowed (public) +myObj.y = 50; // Not allowed (private) +myObj.z = 75; // Not allowed (protected) + +``` + + +### Getters and Setters + +```cpp +class MyClass { + private: + int myNum; + public: + void setMyNum(int num) { // Setter + myNum = num; + } + int getMyNum() { // Getter + return myNum; + } +}; + +MyClass myObj; +myObj.setMyNum(15); // Set the value of myNum to 15 +cout << myObj.getMyNum() << endl; // Output 15 + +``` + + +### Inheritance + +```cpp +class Vehicle { + public: + string brand = "Ford"; + void honk() { + cout << "Tuut, tuut!" << endl; + } +}; + +class Car : public Vehicle { + public: + string model = "Mustang"; +}; + +Car myCar; +myCar.honk(); // Output "Tuut, tuut!" +cout << myCar.brand + " " + myCar.model << endl; // Output "Ford Mustang" +``` + + + C++ Preprocessor ------------ diff --git a/source/_posts/css.md b/source/_posts/css3.md similarity index 100% rename from source/_posts/css.md rename to source/_posts/css3.md diff --git a/source/_posts/ejs.md b/source/_posts/ejs.md new file mode 100644 index 0000000..d3cfcf8 --- /dev/null +++ b/source/_posts/ejs.md @@ -0,0 +1,327 @@ +--- +title: EJS +date: 2023-04-07 +background: bg-[#b4ca65] +tags: + - EJS + - Frontend + - Framework +categories: + - Programming +intro: EJS(Embedded JavaScript) is a simple templating language that lets you generate HTML markup with plain JavaScript. +plugins: + - copyCode +--- + +Get Started { .cols-3 } +----------- + +### Hello world + +#### install +``` +npm install ejs +``` + +#### hello.ejs +```html +<% if (user.email) { %> +

<%= user.email %>

+<% } %> +``` + +#### CLI +```shell +$ ejs hello.ejs -o hello.html +``` + + + +### Render with Data + +``` +let ejs = require('ejs'); + +let people = ['geddy', 'neil', 'alex']; +let tpl = '<%= people.join(", "); %>'; + +let html = ejs.render(tpl, {people: people}); +console.log(html); +``` +Pass EJS a template string and some data. + + + +### Browser Support + +``` + + +``` +Use ejs in a script tag. + + + +### Variables +| | | +|--------------|----------------------------------| +| `<%= var %>` | Prints the value of the variable | +| `<%- var %>` | Prints without HTML escaping | + + +### CLI + +Render and specify an output file. +```shell +$ ejs hello.ejs -o hello.html +``` + +Feed it a template file and a data file +```shell +$ ejs hello.ejs -f data.json -o hello.html +``` + + + +### Comments +```html +<%# This line will denote a comment %> +``` +--------- +```html +<%# This is a multi-line EJS comment. + It can span multiple lines, + but will not be displayed + in the final HTML output. +%> +``` + + + + +### Method + +``` +let ejs = require('ejs'); +let template = ejs.compile(str, options); + +template(data); +// => Rendered HTML string + +ejs.render(str, data, options); +// => Rendered HTML string + +ejs.renderFile(filename, data, options, function(err, str){ + // str => Rendered HTML string +}); +``` + + + +### Including Files + +```html +<%- include('partials/navbar.ejs') %> +``` + +Include a template with data: + +```html +<% include('header', { title: 'My Page' }) %> +``` +------------ + +```html + +``` + +To include a template, needs a file name option, paths are relative + + + +Docs {.cols-3} +-------- + + +### Conditionals +```html +<% if (userLoggedIn) { %> +

Welcome, <%= username %>!

+<% } else { %> +

Please log in.

+<% } %> +``` + + +### Using loops +```html +<% if (userLoggedIn) { %> +

Welcome, <%= username %>!

+<% } else { %> +

Please log in.

+<% } %> +``` + + + +### Custom delimiters + +``` +let ejs = require('ejs'), + users = ['geddy', 'neil', 'alex']; + +// Just one template +ejs.render('', + {users: users}, + {delimiter: '?'}); +// => 'geddy | neil | alex' + +// Or globally +ejs.delimiter = '$'; +ejs.render('<$= users.join(" | "); $>', + {users: users}); +// => 'geddy | neil | alex' +``` + + + + +### Caching + +``` +let ejs = require('ejs'), +LRU = require('lru-cache'); + +// LRU cache with 100-item limit +ejs.cache = LRU(100); +``` + +### Custom file loader + +``` +let ejs = require('ejs'); +let myFileLoader = function (filePath) { + return 'myFileLoader: ' + fs.readFileSync(filePath); +}; + +ejs.fileLoader = myFileLoader; +``` + +### Layouts + +``` +<%- include('header'); -%> +

+ Title +

+

+ My page +

+<%- include('footer'); -%> +``` + +## Client-side support { .cols-2 } + +### Example + +``` +
+ + +``` + +### Caveats + +``` +let str = "Hello <%= include('file', {person: 'John'}); %>", + fn = ejs.compile(str, {client: true}); + +fn(data, null, function(path, d){ // include callback + // path -> 'file' + // d -> {person: 'John'} + // Put your code here + // Return the contents of file as a string +}); // returns rendered string +``` + + +## Options { .cols-1 } + +### Options list +| Option | Description | +|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| cache | Compiled functions are cached, requires filename | +| filename | Used by cache to key caches, and for includes | +| root | Set project root for includes with an absolute path (e.g., /file.ejs). Can be an array to try to resolve include from multiple directories. | +| views | An array of paths to use when resolving includes with relative paths. | +| context | Function execution context | +| compileDebug | When false, no debug instrumentation is compiled | +| client | Returns standalone compiled function | +| delimiter | Character to use for inner delimiter, by default '%' | +| openDelimiter | Character to use for opening delimiter, by default '<' | +| closeDelimiter | Character to use for closing delimiter, by default '>' | +| debug | Outputs generated function body | +| strict | When set to `true`, generated function is in strict mode | +| _with | Whether or not to use with() {} constructs. If false, then the locals will be stored in the locals object. (Implies `--strict`) | +| localsName | Name to use for the object storing local variables when not using with Defaults to locals | +| rmWhitespace | Remove all safe-to-remove whitespace, including leading and trailing whitespace. It also enables a safer version of -%> line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line). | +| escape | The escaping function used with <%= construct. It is used in rendering and is .toString()ed in the generation of client functions. (By default escapes XML). | +| outputFunctionName| Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. | +| async | When true, EJS will use an async function for rendering. (Depends on async/await support in the JS runtime. | + +## Tags { .cols-1 } + +### Tags list +| Tag | Description | +|------|----------------------------------------------------------------------| +| <% | 'Scriptlet' tag, for control-flow, no output | +| <%_ | 'Whitespace Slurping' Scriptlet tag, strips all whitespace before it | +| <%= | Outputs the value into the template (HTML escaped) | +| <%- | Outputs the unescaped value into the template | +| <%# | Comment tag, no execution, no output | +| <%% | Outputs a literal '<%' | +| %> | Plain ending tag | +| -%> | Trim-mode ('newline slurp') tag, trims following newline | +| _%> | 'Whitespace Slurping' ending tag, removes all whitespace after it | + +## Cli { .cols-1 } + +### Cli list +| Option | Description | +|----------------|-------------------------------------------------------------------------------------------------------------------------| +| cache | Compiled functions are cached, requires filename | +| -o / --output-file FILE | Write the rendered output to FILE rather than stdout. | +| -f / --data-file FILE | Must be JSON-formatted. Use parsed input from FILE as data for rendering. | +| -i / --data-input STRING | Must be JSON-formatted and URI-encoded. Use parsed input from STRING as data for rendering. | +| -m / --delimiter CHARACTER | Use CHARACTER with angle brackets for open/close (defaults to %). | +| -p / --open-delimiter CHARACTER | Use CHARACTER instead of left angle bracket to open. | +| -c / --close-delimiter CHARACTER| Use CHARACTER instead of right angle bracket to close. | +| -s / --strict | When set to `true`, generated function is in strict mode | +| -n / --no-with | Use 'locals' object for vars rather than using `with` (implies --strict). | +| -l / --locals-name | Name to use for the object storing local variables when not using `with`. | +| -w / --rm-whitespace | Remove all safe-to-remove whitespace, including leading and trailing whitespace. | +| -d / --debug | Outputs generated function body | +| -h / --help | Display this help message. | +| -V/v / --version | Display the EJS version. | + + +Examples of use : +``` +$ ejs -p [ -c ] ./template_file.ejs -o ./output.html +$ ejs ./test/fixtures/user.ejs name=Lerxst +$ ejs -n -l _ ./some_template.ejs -f ./data_file.json +``` diff --git a/source/_posts/homebrew.md b/source/_posts/homebrew.md new file mode 100644 index 0000000..d44b085 --- /dev/null +++ b/source/_posts/homebrew.md @@ -0,0 +1,176 @@ +--- +title: Homebrew +date: 2023-04-12 +background: bg-[#fbb041] +tags: + - packages manager + - macos +categories: + - Toolkit +intro: This is a quick reference cheat sheet to getting started with homebrew. +plugins: + - copyCode +--- + +## Getting Started + +### Install + +If not installed, instll Command Line Tools (CTL) + +``` +xcode-select --install +``` + +Install Homebrew : + +``` +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +### Commands + +| | | +|----------------------------------|----------------------------------------| +| ``` brew install git ``` | Install a package | +| ``` brew uninstall git ``` | Uninstall a package | +| ``` brew upgrade git ``` | Upgrade package | +| ``` brew unlink git ``` | Unlink | +| ``` brew link git ``` | Link | +| ``` brew switch git 1.0.0 ``` | Switch package version | +| ``` brew list --versions git ``` | List the installed versions of package | + + +### Help + +Display the version of Homebrew. +```` +brew --version +```` +Print Help Information +```` +brew help +```` +Print Help Info for a brew command +```` +brew help +```` +Check system for potential problems. +```` +brew doctor +```` + +### Updates + +Fetch latest version of homebrew and formula +``` +brew update +``` +Show formulae with an updated version available +``` +brew outdated +``` +Upgrade all outdated and unpinned brews +``` +brew upgrade +``` +Upgrade only the specified brew +``` +brew upgrade +``` +Prevent the specified formulae from being upgraded +``` +brew pin +``` +Allow the specified formulae to be upgraded. +``` +brew unpin +``` + +### Repositories + +List all the current tapped repositories (taps) +``` +brew tap +``` +Tap a formula repository from Github using https for tap https://github.com/user/homebrew-repo +``` +brew tap +``` +Tap a formula repository from the specified URL +``` +brew tap +``` +Remove the given tap from the repository +``` +brew untap +``` + +### Cask + +Tap the Cask repository from Github. +``` +brew tap homebrew/cask +``` +List all the installed casks . +``` +brew cask list +``` +Search all known casks based on the substring text. +``` +brew search +``` +Install the given cask. +``` +brew cask install +``` +Reinstalls the given Cask +``` +brew cask reinstall +``` +Uninstall the given cask. +``` +brew cask uninstall +``` + +### Search, Install, Remove + +List all the installed formulae. +``` +brew list +``` +Display all locally available formulae for brewing. +``` +brew search +``` +Perform a substring search of formulae names for brewing. +``` +brew search +``` +Display information about the formula. +``` +brew info +``` +Install the formula. +``` +brew install +``` +Uninstall the formula. +``` +brew uninstall +``` + +### Cleanup + +Remove older versions of installed formulae. +``` +brew cleanup +``` +Remove older versions of specified formula. +``` +brew cleanup +``` +Display all formula that will be removed (dry run) +``` +brew cleanup -n +``` \ No newline at end of file diff --git a/source/_posts/javascript.md b/source/_posts/javascript.md index 7ed94f0..29404cc 100644 --- a/source/_posts/javascript.md +++ b/source/_posts/javascript.md @@ -589,6 +589,92 @@ numbers.concat(newFirstNumber) if you want to avoid mutating your original array, you can use concat. +JavaScipt Set +------------ + +### Create Set + +```javascript +// Empty Set Object +const emptySet = new Set() + +// Set Object with values +const setObj = new Set([1, true, "hi"]) +``` + + +### Add + +```javascript +const emptySet = new Set() + +// add values +emptySet.add('a') // 'a' +emptySet.add(1) // 'a', 1 +emptySet.add(true) // 'a', 1, true +emptySet.add('a') // 'a', 1, true +``` + + +### Delete + +```javascript +const emptySet = new Set([1, true, 'a']) + +// delete values +emptySet.delete('a') // 1, true +emptySet.delete(true) // 1 +emptySet.delete(1) // +``` + + +### Has + +```javascript +const setObj = new Set([1, true, 'a']) + +// returns true or false +setObj.has('a') // true +setObj.has(1) // true +setObj.has(false) // false +``` + + +### Clear + +```javascript +const setObj = new Set([1, true, 'a']) + +// clears the set +console.log(setObj) // 1, true, 'a' +setObj.clear() // +``` + + +### Size + +```javascript +const setObj = new Set([1, true, 'a']) + +consoloe.log(setObj.size) // 3 +``` + + +### ForEach + +```javascript +const setObj = new Set([1, true, 'a']) + +setObj.forEach(function(value){ + console.log(value) +}) + +// 1 +// true +// 'a' +``` + + JavaScript Loops ------------ diff --git a/source/_posts/mitmproxy.md b/source/_posts/mitmproxy.md index 0e41d58..cc69528 100644 --- a/source/_posts/mitmproxy.md +++ b/source/_posts/mitmproxy.md @@ -54,6 +54,51 @@ h ◀ ─── + ─── ▶ l ││ page +### Copy to Clipboard + + +Command Syntax: +``` +:export.clip format flow +``` +---------------- +Example: + +| Description | Command Example | +|--------------------------------|------------------------------------| +| 1. Copy as a curl command | `:export.clip curl @focus` | +| 2. Copy as a httpie | `:export.clip httpie @focus` | +| 2. Copy as a raw | `:export.clip raw @focus` | +| 2. Copy as a raw HTTP request | `:export.clip raw_request @focus` | +| 2. Copy as a raw HTTP response | `:export.clip raw_response @focus` | +{.style-list} + +Export a flow to the system clipboard. + + + + +### Save to File + +Command Syntax: +``` +:export.file format flow path +``` +---------------- +Example: + +| Description | Command Example | +|------------------------------|----------------------------------------------------| +| 1. Export to /tmp/a.curl | `:export.file curl @focus /tmp/a.curl` | +| 2. Export to /tmp/a.httpie | `:export.file httpie @focus /tmp/a.httpie` | +| 2. Export to /tmp/a.raw | `:export.file raw @focus /tmp/a.raw` | +| 2. Export to /tmp/a.request | `:export.file raw_request @focus /tmp/a.request` | +| 2. Export to /tmp/a.response | `:export.file raw_response @focus /tmp/a.response` | +{.style-list} + +Export a flow to the system clipboard. + + ### Common Keybindings | - | - | diff --git a/source/_posts/mongodb.md b/source/_posts/mongodb.md new file mode 100644 index 0000000..58cbde2 --- /dev/null +++ b/source/_posts/mongodb.md @@ -0,0 +1,458 @@ +--- +title: MongoDB +date: 2023-04-05 +background: bg-gradient-to-r from-green-900 via-green-600 to-green-400 hover:from-green-900 hover:via-green-700 hover:to-green-500 +tags: + - NoSQL + - DB +categories: + - Database +intro: The MongoDB cheat sheet provides you with the most commonly used MongoDB commands and queries for your reference. the cheatsheet is from mongodb developers website +plugins: + - tooltip + - copyCode +--- + +## Getting Started {.cols-2} + +### Connect MongoDB Shell + +```mongosh +mongo # connects to mongodb://127.0.0.1:27017 by default +``` + +```mongosh +mongo --host --port -u -p # omit the password if you want a prompt +``` + +```mongosh +mongo "mongodb://192.168.1.1:27017" +``` + +```mongosh +mongo "mongodb+srv://cluster-name.abcde.mongodb.net/" --username # MongoDB Atlas +``` + +### Helpers + +show dbs : + +```mongosh +db // prints the current database +``` + +Switch database : + +```mongosh +use +``` + +Show collections : + +```mongosh +show collections +``` + +Run JavaScript file : + +```mongosh +load("myScript.js") +``` + +--- + +## Crud + +### Create + +```mongosh +db.coll.insertOne({name: "Max"}) +db.coll.insert([{name: "Max"}, {name:"Alex"}]) // ordered bulk insert +db.coll.insert([{name: "Max"}, {name:"Alex"}], {ordered: false}) // unordered bulk insert +db.coll.insert({date: ISODate()}) +db.coll.insert({name: "Max"}, {"writeConcern": {"w": "majority", "wtimeout": 5000}}) +``` + +### Delete + +```mongosh +db.coll.remove({name: "Max"}) +db.coll.remove({name: "Max"}, {justOne: true}) +db.coll.remove({}) // WARNING! Deletes all the docs but not the collection itself and its index definitions +db.coll.remove({name: "Max"}, {"writeConcern": {"w": "majority", "wtimeout": 5000}}) +db.coll.findOneAndDelete({"name": "Max"}) +``` + +### Update + +```mongosh +db.coll.update({"_id": 1}, {"year": 2016}) // WARNING! Replaces the entire document +db.coll.update({"_id": 1}, {$set: {"year": 2016, name: "Max"}}) +db.coll.update({"_id": 1}, {$unset: {"year": 1}}) +db.coll.update({"_id": 1}, {$rename: {"year": "date"} }) +db.coll.update({"_id": 1}, {$inc: {"year": 5}}) +db.coll.update({"_id": 1}, {$mul: {price: NumberDecimal("1.25"), qty: 2}}) +db.coll.update({"_id": 1}, {$min: {"imdb": 5}}) +db.coll.update({"_id": 1}, {$max: {"imdb": 8}}) +db.coll.update({"_id": 1}, {$currentDate: {"lastModified": true}}) +db.coll.update({"_id": 1}, {$currentDate: {"lastModified": {$type: "timestamp"}}}) +``` + +### Array { .row-span-2 } + +```mongosh +db.coll.update({"_id": 1}, {$push :{"array": 1}}) +db.coll.update({"_id": 1}, {$pull :{"array": 1}}) +db.coll.update({"_id": 1}, {$addToSet :{"array": 2}}) +db.coll.update({"_id": 1}, {$pop: {"array": 1}}) // last element +db.coll.update({"_id": 1}, {$pop: {"array": -1}}) // first element +db.coll.update({"_id": 1}, {$pullAll: {"array" :[3, 4, 5]}}) +db.coll.update({"_id": 1}, {$push: {scores: {$each: [90, 92, 85]}}}) +db.coll.updateOne({"_id": 1, "grades": 80}, {$set: {"grades.$": 82}}) +db.coll.updateMany({}, {$inc: {"grades.$[]": 10}}) +db.coll.update({}, {$set: {"grades.$[element]": 100}}, {multi: true, arrayFilters: [{"element": {$gte: 100}}]}) +``` + +### Update many { .row-span-1 } + +```mongosh +db.coll.update({"year": 1999}, {$set: {"decade": "90's"}}, {"multi":true}) +db.coll.updateMany({"year": 1999}, {$set: {"decade": "90's"}}) +``` + +### FindOneAndUpdate { .row-span-1 } + +```mongosh +db.coll.findOneAndUpdate({"name": "Max"}, {$inc: {"points": 5}}, {returnNewDocument: true}) +``` + +### Upsert { .row-span-1 } + +```mongosh +db.coll.update({"_id": 1}, {$set: {item: "apple"}, $setOnInsert: {defaultQty: 100}}, {upsert: true}) +``` + +### Replace { .row-span-1 } + +```mongosh +db.coll.replaceOne({"name": "Max"}, {"firstname": "Maxime", "surname": "Beugnet"}) +``` + +### Save { .row-span-1 } + +```mongosh +db.coll.save({"item": "book", "qty": 40}) +``` + +### Write concern { .row-span-1 } + +```mongosh +db.coll.update({}, {$set: {"x": 1}}, {"writeConcern": {"w": "majority", "wtimeout": 5000}}) +``` + +### Find { .row-span-2 } + +```mongosh +db.coll.findOne() // returns a single document +db.coll.find() // returns a cursor - show 20 results - "it" to display more +db.coll.find().pretty() +db.coll.find({name: "Max", age: 32}) // implicit logical "AND". +db.coll.find({date: ISODate("2020-09-25T13:57:17.180Z")}) +db.coll.find({name: "Max", age: 32}).explain("executionStats") // or "queryPlanner" or "allPlansExecution" +db.coll.distinct("name") +``` + +### Count + +```mongosh +db.coll.count({age: 32}) // estimation based on collection metadata +db.coll.estimatedDocumentCount() // estimation based on collection metadata +db.coll.countDocuments({age: 32}) // alias for an aggregation pipeline - accurate count +``` + +### Comparison + +```mongosh +db.coll.find({"year": {$gt: 1970}}) +db.coll.find({"year": {$gte: 1970}}) +db.coll.find({"year": {$lt: 1970}}) +db.coll.find({"year": {$lte: 1970}}) +db.coll.find({"year": {$ne: 1970}}) +db.coll.find({"year": {$in: [1958, 1959]}}) +db.coll.find({"year": {$nin: [1958, 1959]}}) +``` + +### Logical + +```mongosh +db.coll.find({name:{$not: {$eq: "Max"}}}) +db.coll.find({$or: [{"year" : 1958}, {"year" : 1959}]}) +db.coll.find({$nor: [{price: 1.99}, {sale: true}]}) +db.coll.find({ +$and: [ + {$or: [{qty: {$lt :10}}, {qty :{$gt: 50}}]}, +{$or: [{sale: true}, {price: {$lt: 5 }}]} +] +}) +``` + +### Element + +```mongosh +db.coll.find({name: {$exists: true}}) +db.coll.find({"zipCode": {$type: 2 }}) +db.coll.find({"zipCode": {$type: "string"}}) +``` + +### Aggregation Pipeline + +```mongosh +db.coll.aggregate([ +{$match: {status: "A"}}, +{$group: {_id: "$cust_id", total: {$sum: "$amount"}}}, +{$sort: {total: -1}} +]) +``` + +### Text search with a "text" index + +```mongosh +db.coll.find({$text: {$search: "cake"}}, {score: {$meta: "textScore"}}).sort({score: {$meta: "textScore"}}) +``` + +### Regex + +```mongosh +db.coll.find({name: /^Max/}) // regex: starts by letter "M" +db.coll.find({name: /^Max$/i}) // regex case insensitive +``` + +### Array + +```mongosh +db.coll.find({tags: {$all: ["Realm", "Charts"]}}) +db.coll.find({field: {$size: 2}}) // impossible to index - prefer storing the size of the array & update it +db.coll.find({results: {$elemMatch: {product: "xyz", score: {$gte: 8}}}}) +``` + +### Projections + +```mongosh +db.coll.find({"x": 1}, {"actors": 1}) // actors + \_id +db.coll.find({"x": 1}, {"actors": 1, "\_id": 0}) // actors +db.coll.find({"x": 1}, {"actors": 0, "summary": 0}) // all but "actors" and "summary" +``` + +### Sort, skip, limit + +```mongosh +db.coll.find({}).sort({"year": 1, "rating": -1}).skip(10).limit(3) +``` + +### Read Concern + +```mongosh +db.coll.find().readConcern("majority") +``` + + +## Databases and Collections { .cols-2 } + +### Drop { .row-span-1 } + +```mongosh +db.coll.drop() // removes the collection and its index definitions +db.dropDatabase() // double check that you are *NOT* on the PROD cluster... :-) +``` + +### Create Collection { .row-span-2} + +```mongosh +db.createCollection("contacts", { + validator: {$jsonSchema: { + bsonType: "object", + required: ["phone"], + properties: { + phone: { + bsonType: "string", + description: "must be a string and is required" + }, + email: { + bsonType: "string", + pattern: "@mongodb\.com$", + description: "must be a string and match the regular expression pattern" + }, + status: { + enum: [ "Unknown", "Incomplete" ], + description: "can only be one of the enum values" + } + } + }} +}) +``` + +### Other Collection Functions { .row-span-1} + +```mongosh +db.coll.stats() +db.coll.storageSize() +db.coll.totalIndexSize() +db.coll.totalSize() +db.coll.validate({full: true}) +db.coll.renameCollection("new_coll", true) // 2nd parameter to drop the target collection if exists +``` + + +## Indexes {.cols-2} + +### Basics + +#### List + +```mongosh +db.coll.getIndexes() +db.coll.getIndexKeys() +``` + +#### Drop Indexes + +```mongosh +db.coll.dropIndex("name_1") +``` + +#### Hide/Unhide Indexes + +```mongosh +db.coll.hideIndex("name_1") +db.coll.unhideIndex("name_1") +``` + +### Create Indexes + +```mongosh +// Index Types +db.coll.createIndex({"name": 1}) // single field index +db.coll.createIndex({"name": 1, "date": 1}) // compound index +db.coll.createIndex({foo: "text", bar: "text"}) // text index +db.coll.createIndex({"$**": "text"}) // wildcard text index +db.coll.createIndex({"userMetadata.$**": 1}) // wildcard index +db.coll.createIndex({"loc": "2d"}) // 2d index +db.coll.createIndex({"loc": "2dsphere"}) // 2dsphere index +db.coll.createIndex({"_id": "hashed"}) // hashed index + +// Index Options +db.coll.createIndex({"lastModifiedDate": 1}, {expireAfterSeconds: 3600}) // TTL index +db.coll.createIndex({"name": 1}, {unique: true}) +db.coll.createIndex({"name": 1}, {partialFilterExpression: {age: {$gt: 18}}}) // partial index +db.coll.createIndex({"name": 1}, {collation: {locale: 'en', strength: 1}}) // case insensitive index with strength = 1 or 2 +db.coll.createIndex({"name": 1 }, {sparse: true}) +``` + +## Others { .cols-2 } + +### Handy commands { .row-span-3 } + +```mongosh +use admin +db.createUser({"user": "root", "pwd": passwordPrompt(), "roles": ["root"]}) +db.dropUser("root") +db.auth( "user", passwordPrompt() ) + +use test +db.getSiblingDB("dbname") +db.currentOp() +db.killOp(123) // opid + +db.fsyncLock() +db.fsyncUnlock() + +db.getCollectionNames() +db.getCollectionInfos() +db.printCollectionStats() +db.stats() + +db.getReplicationInfo() +db.printReplicationInfo() +db.isMaster() +db.hostInfo() +db.printShardingStatus() +db.shutdownServer() +db.serverStatus() + +db.setSlaveOk() +db.getSlaveOk() + +db.getProfilingLevel() +db.getProfilingStatus() +db.setProfilingLevel(1, 200) // 0 == OFF, 1 == ON with slowms, 2 == ON + +db.enableFreeMonitoring() +db.disableFreeMonitoring() +db.getFreeMonitoringStatus() + +db.createView("viewName", "sourceColl", [{$project:{department: 1}}]) +``` + +### Replica Set { .row-span-2} + +```mongosh +rs.status() +rs.initiate({"_id": "replicaTest", + members: [ + { _id: 0, host: "127.0.0.1:27017" }, + { _id: 1, host: "127.0.0.1:27018" }, + { _id: 2, host: "127.0.0.1:27019", arbiterOnly:true }] +}) +rs.add("mongodbd1.example.net:27017") +rs.addArb("mongodbd2.example.net:27017") +rs.remove("mongodbd1.example.net:27017") +rs.conf() +rs.isMaster() +rs.printReplicationInfo() +rs.printSlaveReplicationInfo() +rs.reconfig() +rs.slaveOk() +rs.stepDown(20, 5) // (stepDownSecs, secondaryCatchUpPeriodSecs) +``` + +### Sharded Cluster { .row-span-2 } + +```mongosh +sh.status() +sh.addShard("rs1/mongodbd1.example.net:27017") +sh.shardCollection("mydb.coll", {zipcode: 1}) + +sh.moveChunk("mydb.coll", { zipcode: "53187" }, "shard0019") +sh.splitAt("mydb.coll", {x: 70}) +sh.splitFind("mydb.coll", {x: 70}) +sh.disableAutoSplit() +sh.enableAutoSplit() + +sh.startBalancer() +sh.stopBalancer() +sh.disableBalancing("mydb.coll") +sh.enableBalancing("mydb.coll") +sh.getBalancerState() +sh.setBalancerState(true/false) +sh.isBalancerRunning() + +sh.addTagRange("mydb.coll", {state: "NY", zip: MinKey }, { state: "NY", zip: MaxKey }, "NY") +sh.removeTagRange("mydb.coll", {state: "NY", zip: MinKey }, { state: "NY", zip: MaxKey }, "NY") +sh.addShardTag("shard0000", "NYC") +sh.removeShardTag("shard0000", "NYC") + +sh.addShardToZone("shard0000", "JFK") +sh.removeShardFromZone("shard0000", "NYC") +sh.removeRangeFromZone("mydb.coll", {a: 1, b: 1}, {a: 10, b: 10}) +``` +### Change Streams {.row-span-1 } + +```mongosh +watchCursor = db.coll.watch( [ { $match : {"operationType" : "insert" } } ] ) + +while (!watchCursor.isExhausted()){ + if (watchCursor.hasNext()){ + print(tojson(watchCursor.next())); + } +} +``` \ No newline at end of file diff --git a/source/_posts/pandoc.md b/source/_posts/pandoc.md new file mode 100644 index 0000000..0c70fd5 --- /dev/null +++ b/source/_posts/pandoc.md @@ -0,0 +1,64 @@ +--- +title: Pandoc +date: 2023-03-21 13:26:00 +background: bg-red-400 +tags: + - convert + - document + - utility +categories: + - Linux Command +intro: | + [Pandoc](https://pandoc.org) is a document converter, this pandoc cheat sheet contains pandoc commands and some common pandoc tricks. +plugins: + - copyCode +--- + +Getting Started +--------------- + +### Pandoc Usage + +Syntax +```shell script +$ pandoc -s [source file] -o [output file] +``` + + +Pandoc examples +---------- + + +### LaTeX to MS Word {.col-span-2} + +Simple .tex to .docx +```shell script +$ pandoc -s file.tex -o file.docx +``` + +.tex to .docx with default citations +```shell script +$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib -o file.docx +``` + +.tex to .docx with specific citations +```shell script +$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib --csl=apa.csl -o file.docx +``` +Get `.csl` file from [here](https://github.com/citation-style-language/styles) + +.tex to .docx with cross references +```shell script +$ pandoc -s file.tex --filter pandoc-crossref -o file.docx +``` +Get the filter `pandoc-crossref` from [here](https://github.com/lierdakil/pandoc-crossref/releases) + + + + + +Also see {.cols-1} +---------- +- [pandoc examples](https://pandoc.org/demos.html) + + diff --git a/source/_posts/postgres.md b/source/_posts/postgres.md index 0f29944..a2ed36f 100644 --- a/source/_posts/postgres.md +++ b/source/_posts/postgres.md @@ -259,7 +259,7 @@ VALUES ( , ); ### Data -[Select](http://www.postgresql.org/docs/current/static/sql-select.html] all data +[Select](http://www.postgresql.org/docs/current/static/sql-select.html) all data ```sql {.wrap} SELECT * FROM ; ``` diff --git a/source/_posts/pytorch.md b/source/_posts/pytorch.md new file mode 100644 index 0000000..fac0124 --- /dev/null +++ b/source/_posts/pytorch.md @@ -0,0 +1,223 @@ +--- +title: PyTorch +date: 2023-04-12 +background: bg-[#ee4c2c] +tags: + - AI + - Python +categories: + - Other +intro: This is a quick reference list of cheat sheets for PyTorch. See also [PyTorch website](https://pytorch.org/) +--- + +## Imports { .cols-1 } + +### General + +``` +import torch # root package +from torch.utils.data import Dataset, DataLoader # dataset representation and loading +``` + +### Neural Network API + +``` +import torch.autograd as autograd # computation graph +from torch import Tensor # tensor node in the computation graph +import torch.nn as nn # neural networks +import torch.nn.functional as F # layers, activations and more +import torch.optim as optim # optimizers e.g. gradient descent, ADAM, etc. +from torch.jit import script, trace # hybrid frontend decorator and tracing jit +``` + +### Torchscript and JIT + +``` +torch.jit.trace() # takes your module or function and an example + # data input, and traces the computational steps + # that the data encounters as it progresses through the model + +@script # decorator used to indicate data-dependent + # control flow within the code being traced +``` + +### ONNX + +``` +torch.onnx.export(model, dummy data, xxxx.proto) # exports an ONNX formatted + # model using a trained model, dummy + # data and the desired file name + +model = onnx.load("alexnet.proto") # load an ONNX model +onnx.checker.check_model(model) # check that the model + # IR is well formed + +onnx.helper.printable_graph(model.graph) # print a human readable + # representation of the graph +``` + +### Vision + + +``` +from torchvision import datasets, models, transforms # vision datasets, + # architectures & + # transforms + +import torchvision.transforms as transforms # composable transforms +``` + +### Distributed Training + +``` +import torch.distributed as dist # distributed communication +from torch.multiprocessing import Process # memory sharing processes +``` + +## Tensors { .cols-1 } + +### Creation + +``` +x = torch.randn(*size) # tensor with independent N(0,1) entries +x = torch.[ones|zeros](*size) # tensor with all 1's [or 0's] +x = torch.tensor(L) # create tensor from [nested] list or ndarray L +y = x.clone() # clone of x +with torch.no_grad(): # code wrap that stops autograd from tracking tensor history +requires_grad=True # arg, when set to True, tracks computation + # history for future derivative calculations +``` + +### Dimensionality + +``` +x.size() # return tuple-like object of dimensions +x = torch.cat(tensor_seq, dim=0) # concatenates tensors along dim +y = x.view(a,b,...) # reshapes x into size (a,b,...) +y = x.view(-1,a) # reshapes x into size (b,a) for some b +y = x.transpose(a,b) # swaps dimensions a and b +y = x.permute(*dims) # permutes dimensions +y = x.unsqueeze(dim) # tensor with added axis +y = x.unsqueeze(dim=2) # (a,b,c) tensor -> (a,b,1,c) tensor +y = x.squeeze() # removes all dimensions of size 1 (a,1,b,1) -> (a,b) +y = x.squeeze(dim=1) # removes specified dimension of size 1 (a,1,b,1) -> (a,b,1) +``` + +### Algebra + +``` +ret = A.mm(B) # matrix multiplication +ret = A.mv(x) # matrix-vector multiplication +x = x.t() # matrix transpose +``` + +### GPU Usage + +``` +torch.cuda.is_available # check for cuda +x = x.cuda() # move x's data from + # CPU to GPU and return new object + +x = x.cpu() # move x's data from GPU to CPU + # and return new object + +if not args.disable_cuda and torch.cuda.is_available(): # device agnostic code + args.device = torch.device('cuda') # and modularity +else: # + args.device = torch.device('cpu') # + +net.to(device) # recursively convert their + # parameters and buffers to + # device specific tensors + +x = x.to(device) # copy your tensors to a device + # (gpu, cpu) +``` + +### Deep Learning + +``` +nn.Linear(m,n) # fully connected layer from + # m to n units + +nn.ConvXd(m,n,s) # X dimensional conv layer from + # m to n channels where X⍷{1,2,3} + # and the kernel size is s + +nn.MaxPoolXd(s) # X dimension pooling layer + # (notation as above) + +nn.BatchNormXd # batch norm layer +nn.RNN/LSTM/GRU # recurrent layers +nn.Dropout(p=0.5, inplace=False) # dropout layer for any dimensional input +nn.Dropout2d(p=0.5, inplace=False) # 2-dimensional channel-wise dropout +nn.Embedding(num_embeddings, embedding_dim) # (tensor-wise) mapping from + # indices to embedding vectors +``` + +### Loss Functions + +``` +nn.X # where X is L1Loss, MSELoss, CrossEntropyLoss + # CTCLoss, NLLLoss, PoissonNLLLoss, + # KLDivLoss, BCELoss, BCEWithLogitsLoss, + # MarginRankingLoss, HingeEmbeddingLoss, + # MultiLabelMarginLoss, SmoothL1Loss, + # SoftMarginLoss, MultiLabelSoftMarginLoss, + # CosineEmbeddingLoss, MultiMarginLoss, + # or TripletMarginLoss +``` + +### Activation Functions + +``` +nn.X # where X is ReLU, ReLU6, ELU, SELU, PReLU, LeakyReLU, + # RReLu, CELU, GELU, Threshold, Hardshrink, HardTanh, + # Sigmoid, LogSigmoid, Softplus, SoftShrink, + # Softsign, Tanh, TanhShrink, Softmin, Softmax, + # Softmax2d, LogSoftmax or AdaptiveSoftmaxWithLoss +``` + +### Optimizers + +``` +opt = optim.x(model.parameters(), ...) # create optimizer +opt.step() # update weights +optim.X # where X is SGD, Adadelta, Adagrad, Adam, + # AdamW, SparseAdam, Adamax, ASGD, + # LBFGS, RMSprop or Rprop +``` + +### Learning rate scheduling + +``` +scheduler = optim.X(optimizer,...) # create lr scheduler +scheduler.step() # update lr after optimizer updates weights +optim.lr_scheduler.X # where X is LambdaLR, MultiplicativeLR, + # StepLR, MultiStepLR, ExponentialLR, + # CosineAnnealingLR, ReduceLROnPlateau, CyclicLR, + # OneCycleLR, CosineAnnealingWarmRestarts, +``` + +## Data Utilities { .cols-1 } + +### Datasets + +``` +Dataset # abstract class representing dataset +TensorDataset # labelled dataset in the form of tensors +Concat Dataset # concatenation of Datasets +``` + +### Dataloaders and DataSamplers + +``` +DataLoader(dataset, batch_size=1, ...) # loads data batches agnostic + # of structure of individual data points + +sampler.Sampler(dataset,...) # abstract class dealing with + # ways to sample from dataset + +sampler.XSampler where ... # Sequential, Random, SubsetRandom, + # WeightedRandom, Batch, Distributed +``` \ No newline at end of file diff --git a/source/_posts/swift.md b/source/_posts/swift.md index 994ce83..71a2147 100644 --- a/source/_posts/swift.md +++ b/source/_posts/swift.md @@ -910,7 +910,7 @@ print(setC) // print: ["D", "C"] ``` -### .union() 合并去重 +### .union() ```swift var setA: Set = ["A", "B", "C", "D"] @@ -1275,7 +1275,7 @@ func season(month: Int, name: inout String) { name = "Unknown" } } -season(monthNum: 4, name: ¤tSeason) +season(month: 4, name: ¤tSeason) print(currentSeason) // Spring 🌱 ``` @@ -1369,7 +1369,7 @@ struct TV { var type: String init(size: Int, type: String) { - self. size = size + self.size = size self.type = type } } @@ -1407,8 +1407,8 @@ Using the `Menu` class ```swift var dinerMenu = Menu() -dinerMenu. addToMenu(dish: "Toast") -print(dinerMenu. menuItems) +dinerMenu.addToMenu(dish: "Toast") +print(dinerMenu.menuItems) // prints: ["Fries", "Burgers", "Toast"] ``` @@ -1633,7 +1633,7 @@ enum Season: CaseIterable { case falls } -for season in Season. allCases { +for season in Season.allCases { print(season) } ``` diff --git a/source/_posts/taskset.md b/source/_posts/taskset.md new file mode 100644 index 0000000..1feaeae --- /dev/null +++ b/source/_posts/taskset.md @@ -0,0 +1,117 @@ +--- +title: Taskset +date: 2023-04-07 14:25:44 +background: bg-[#8bbb55] +tags: + - process + - process manager +categories: + - Linux Command +intro: + The taskset command is used to set or retrieve the CPU affinity + of a running process given its pid, or to launch a new command + with a given CPU affinity. +plugins: + - copyCode +--- + +Getting Started {.cols-3} +-------- + +### Usage +The default behavior is to run a new command with a given affinity mask +```shell +$ taskset [mask] [command] [arguments] +``` + +#### Usage #2 +```shell +$ taskset -p [pid] +``` +--------- +```shell +$ taskset -p [mask] [pid] +``` +You can also retrieve the CPU affinity of an existing task + + + ### Common Options {.col-span-2} +| Command | Alternavite | Meaning | +|---------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------| +| `-a` | --all-tasks | Set or retrieve the CPU affinity of all the task (threads) for a given PID. | +| `-c` | --cpu-list | Interpret mask as numerical list of processors instead of a bitmask.
Numbers are separated by commas and may include ranges. For example: `0,5,8-11` | +| `-p` | --pid | Operate on an existing PID and do not launch a new task. | +| `-h` | --help | Display help text and exit. | +| `-v` | --version | Print version and exit. | +{.show-header} + +Example +-------- + +### View CPU Affinity +```shell +$ taskset -cp 29523 +pid 29523's current affinity list: 0-15 +``` +That mean process with PID `29523` is active on CPU range from `[0,1,...,15]` which means `16` total. + +**PID**: Process Identifier - is a unique numerical identifier given to each running process, you can view PID of processes in `top` or `htop` tools + +_If you run the above command but get the message `bad usage`, try with PID = 1_ + + ```shell + $ taskset -cp 1 + ``` + +### Set CPU Affinity +Now let's try to set process in to a specify CPU. For example, we have a process has PID = 14846 + +Let's see the CPU affinity list of this process first: +```shell +$ taskset -cp 14846 +pid 14846's current affinity list: 0-15 +``` + +#### Change CPU affinity to 1: +```shell +$ taskset -cp 1 14846 +pid 14846's current affinity list: 0-15 +pid 14846's new affinity list: 1 +``` +As we see, CPU affinity was changed + +### Set CPU Affinity with muliple value +That mean new CPU affinity list is `[0,1,2,3]` +```shell +$ taskset -cp 0-3 14846 +pid 14846's current affinity list: 1 +pid 14846's new affinity list: 0-3 +``` + +You can set single CPU with the following command: + +```shell +$ taskset -cp 5,8,12 14846 +pid 14846's current affinity list: 0-3 +pid 14846's new affinity list: 5,8,12 +``` +That mean new CPU affinity list is `[5,8,12]` + +### Other +You can set affinity by range with other like a specify CPU +```shell +$ taskset -cp 1-3,12 14846 +``` + +Or + +```shell +$ taskset -cp 1-6:2 14846 +``` +The suffix ":N" specifies stride in the range, for example 0-10:3 is interpreted as 0,3,6,9 list. + + + +Also see +-------- +[taskset — Linux manual page](https://man7.org/linux/man-pages/man1/taskset.1.html) _(man7.org)_ diff --git a/source/assets/icon/homebrew.svg b/source/assets/icon/homebrew.svg new file mode 100644 index 0000000..3e93075 --- /dev/null +++ b/source/assets/icon/homebrew.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/assets/icon/mongodb.svg b/source/assets/icon/mongodb.svg new file mode 100644 index 0000000..4cf12f6 --- /dev/null +++ b/source/assets/icon/mongodb.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/assets/icon/pytorch.svg b/source/assets/icon/pytorch.svg new file mode 100644 index 0000000..a1940f0 --- /dev/null +++ b/source/assets/icon/pytorch.svg @@ -0,0 +1,2 @@ + +PyTorch icon \ No newline at end of file diff --git a/source/assets/image/css-preview.png b/source/assets/image/css3-preview.png similarity index 100% rename from source/assets/image/css-preview.png rename to source/assets/image/css3-preview.png diff --git a/themes/coo/layout/_partial/footer.ejs b/themes/coo/layout/_partial/footer.ejs index 41dcd04..00c3cca 100644 --- a/themes/coo/layout/_partial/footer.ejs +++ b/themes/coo/layout/_partial/footer.ejs @@ -15,7 +15,7 @@