git init
or
| #include <curl/curl.h> | |
| #include <string> | |
| size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) { | |
| data->append((char*) ptr, size * nmemb); | |
| return size * nmemb; | |
| } | |
| int main(int argc, char** argv) { | |
| auto curl = curl_easy_init(); |
| #!/usr/bin/env bash | |
| # names of latest versions of each package | |
| export NGINX_VERSION=1.15.5 | |
| export VERSION_NGINX=nginx-$NGINX_VERSION | |
| export VERSION_LIBRESSL=libressl-2.8.1 | |
| export VERSION_PCRE=pcre-8.42 | |
| #export NPS_VERSION=1.9.32.10 | |
| #export VERSION_PAGESPEED=v${NPS_VERSION}-beta | |
Some parts taken from: https://gist.github.com/kujohn/7209628
ipfw is officially deprecated and removed in OS X Yosemite. Pow requires another program pf to handle the port forwarding.
Create file /etc/pf.anchors/pow
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)I've developed a useful feature in KeystoneJS that lets you populate a relationship from either side, while only storing the data on one side, and am looking for feedback on whether it is something that could / should be brought back into mongoose itself. (It might be possible to add as a separate package but I suspect there'd be too much rewriting of mongoose internals for that to be a good idea).
I've added this as an issue in mongoose for consideration: #1888 but am leaving this gist in place because the examples are easier to read.
I've used Posts and Categories as a basic, contrived example to demonstrate what I'm talking about here; in reality you'd rarely load all the posts for a category but there are other real world cases where it's less unreasonable you'd want to do this, and Posts + Categories is an easy way to demo it.
The built-in population feature is really useful; not just for
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| """ | |
| Some simple filters | |
| * `user_can`, which filters an object taking a string | |
| parameter, returning True or False depending on whether the current | |
| user "can" do the action in the parameter. This is done by calling | |
| `user_can_<action>` on the object. | |
| Anonymous users always return `False`. | |
| * `user_has`, which pulls the result of the `user_has_<feature>()`; |