def commit(item) error = nil
if action_1(item).success() && action_2(item).success() && action_3(item).success() && action_4(item).success() && action_5(item).success()
# no error, all succeessful
else
error = "something went error"
end
return error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // example code | |
| $records = array(['satu' => 'satu', 'dua' => 'satu'], | |
| ['satu' => 'dua', 'dua' => 'dua'], | |
| ['satu' => 'tiga', 'dua' => 'tiga'], | |
| ['satu' => 'empat', 'dua' => 'empat'], | |
| ['satu' => 'lima', 'dua' => 'lima'], | |
| ['satu' => 'enam', 'dua' => 'enam'], | |
| ['satu' => 'tujuh', 'dua' => 'tujuh'], |
server {
server_name drupal8.test;
root /Users/username/drupal8/web;
location = /favicon.ico {
log_not_found off;
access_log off;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function slugify(string) { | |
| const a = 'àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœṕŕßśșțùúüûǘẃẍÿź·/_,:;' | |
| const b = 'aaaaaaaaceeeeghiiiimnnnoooooprssstuuuuuwxyz------' | |
| const p = new RegExp(a.split('').join('|'), 'g') | |
| return string.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters | |
| .replace(/&/g, '-and-') // Replace & with 'and' | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Verifying my Blockstack ID is secured with the address 1EGRyeLqqXMcseD9fFVCh5zfBzc6WQFMTS https://explorer.blockstack.org/address/1EGRyeLqqXMcseD9fFVCh5zfBzc6WQFMTS |
Most of programs will not accept an email using just @localhost as domain.
So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:
127.0.0.1 localhost.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var app = express(); | |
| var fs = require('fs'); | |
| app.listen(3000, function() { | |
| console.log("[NodeJS] Application Listening on Port 3000"); | |
| }); | |
| app.get('/api/play/:key', function(req, res) { | |
| var key = req.params.key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const outside = {weather: FRIGHTFUL} | |
| const inside = {fire: DELIGHTFUL} | |
| const go = places => places.some(p=>p>outside.weather))) | |
| const snow = () => (outside.weather < inside.fire && !go(places)) { | |
| let it = snow() | |
| } | |
| let it = snow() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //npm init -y | |
| //npm install --save puppeteer | |
| //usage: node script.js /path/to/input.html /path/to/output.pdf | |
| //script.js | |
| const puppeteer = require('puppeteer'); | |
| (async () => { | |