What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-08-29 09:42:01
Writing files in Node.js
const fs = require('fs'); fs.writeFile("/tmp/test", "Hey there!", function(err) { if(err) { return console.log(err); } console.log("The file was saved!"); }); // Or fs.writeFileSync('/tmp/test-sync', 'H... Add solution -
Javascript 2021-08-29 09:26:02
semantic ui react modal
import React from 'react' import { Button, Header, Image, Modal } from 'semantic-ui-react' function ModalExampleModal() { const [open, setOpen] = React.useState(false) return ( <Modal onClose={() => setOpen(false)} onOpen={() =... Add solution -
Javascript 2021-08-29 09:21:02
javascript object to array
var obj = {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} var result = Object.keys(obj).map(function(key) ... Add solution -
Other 2021-08-29 09:18:03
function_exists
<?php if (function_exists('imap_open')) { echo "IMAP functions are available.<br />\n"; } else { echo "IMAP functions are&... Add solution -
Other 2021-08-29 09:18:02
encode an array containing non-utf values
Note that if you try to encode an array containing non-utf values, you'll get null values in the resulting JSON string. You can batch-encode all the elements of an array with the array_map function: <?php $encodedArray = array_map(utf8_encode, $... Add solution