Deploy a Express.js project on Heroku
Step by step from command line by Steve Tuan
const PORT = process.env.PORT || 3000
app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`))
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: Zalora | |
| * Date: 4/4/17 | |
| * Time: 6:14 PM | |
| */ | |
| class Payment_Model_Adyen_Method_CreditCardTest extends PHPUnit_Framework_TestCase | |
| { |
| https://codepen.io/ilovecoding197/pen/YYzXzv |
| john = Passenger.create(name: "John") | |
| jim = Passenger.create(name: "Jim", referrer: john) | |
| bob = Passenger.create(name: "Bob", referrer: john) | |
| $5 $3 $1 | |
| john -> jim -> alex -> Jane | |
| -> bob -> sally | |
| -> kim | |
| cal_bonus(john) = $19 |
| class Notifier | |
| { | |
| constructor() { | |
| this.events = []; | |
| } | |
| on(eventName, callback) { | |
| var self = this; | |
| this.events.push(callback); |
Step by step from command line by Steve Tuan
const PORT = process.env.PORT || 3000
app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`))
| // you can use includes, for example: | |
| // #include <algorithm> | |
| #include <unordered_set> | |
| // you can write to stdout for debugging purposes, e.g. | |
| // cout << "this is a debug message" << endl; | |
| int solution(vector<int> &A) { | |
| // write your code in C++14 (g++ 6.2.0) | |
| unordered_set<int> s; | |
| int max = 0; |
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| int tour(int num_kid, int x) | |
| { | |
| vector<int> v; | |
| for (int i=0; i<num_kid; i++) { | |
| v.push_back(i); | |
| } |
| import requests | |
| API_URL = 'https://en.wikipedia.org/w/api.php?action=parse§ion=0&prop=text&format=json&page=' | |
| def get(topic): | |
| r = requests.get(API_URL + topic) | |
| return r.text | |
| def getTopicCount(topic): | |
| text = get(topic) |
| <?php | |
| $ch = curl_init('https://pal-test.adyen.com/pal/servlet/Payment/v25/refund'); | |
| # Setup request to send json via POST. | |
| $payload = '{ | |
| "merchantAccount": "ZaloraTW", | |
| "modificationAmount": { | |
| "currency": "TWD", | |
| "value": 8739100.00 | |
| }, |
| // delete With temp table | |
| CREATE TABLE temp_users AS | |
| SELECT * FROM users GROUP BY user_name; | |
| DROP TABLE users; | |
| RENAME TABLE temp_users TO users; | |
| // delete and keep lower id | |
| DELETE u1 FROM users u1, users u2 |