Skip to content

Instantly share code, notes, and snippets.

@ceme
ceme / touch_gitignore_node_modules.sh
Created August 23, 2018 06:47
Create .gitignore and and node_modules
touch .gitignore && echo "node_modules/" >> .gitignore
"4096".split('').reduce(function(accumulator, currentValue) {
return Number(accumulator) + Number(currentValue);
})
@ceme
ceme / curl-commands-rest-api.txt
Created January 14, 2018 22:54
curl commands for rest api
GET
curl \
--header "Accept: application/json" \
https://example.com/api/users
POST
curl \
--header "Content-Type:application/json" \
@ceme
ceme / curl_post_json_data
Created December 8, 2017 06:16
Use curl to post to httpbin json data
curl -X POST http://httpbin.org/post -H "Content-Type:application/json" -d "{x:'y',z:'a'}"
@ceme
ceme / curl_post_form_data
Created December 8, 2017 06:13
Use curl to post to httpbin form data
curl -X POST http://httpbin.org/post -d "x=y&z=a"
@ceme
ceme / vuejs-Bind-visibility.html
Created September 8, 2017 05:39
vuejs : Bind visibility
<!doctype html>
<html>
<head>
<title>vuejs : Bind visibility</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 21px Helvetica, Arial; }
span::after {
@ceme
ceme / log_caller.js
Created May 12, 2017 19:23
Javasctipt log calling function
console.log(arguments.callee.caller.toString());
@ceme
ceme / phpunit_write_to_console.txt
Created April 19, 2017 19:19
Output variable to console from phpunit test
fwrite(STDERR, print_r($resp, TRUE));
@ceme
ceme / copy-pubkey-clipboard.txt
Created April 16, 2017 22:58
Copy public key to clipboard
pbcopy < ~/.ssh/id_rsa.pub
@ceme
ceme / factorial.js
Created March 5, 2017 21:28
Recursive factorial function in JavaScript
function factorial(n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n-1);
}
}