What do you want to save?
Add Code snippet
New code examples
-
Swift 2022-03-25 00:20:01
closure swift
// The basic closure syntax is: // { (parameter: Type) -> Type in <statements> } // // While closures can be assigned to a variable like in // the example below, they become much more useful once // they're passed into a function such as a list'... Add solution -
Javascript 2022-03-25 00:15:26
javascript text auto writing
/* Creating a Typing Effect ----------------------------- 1) Add HTML: */ <p id="demo"></p> <button onclick="typeWriter()">Click me</button> /* 2) Add JavaScript: */ var i = 0; var txt = 'Lorem ipsum typing e... Add solution -
Other 2022-03-24 23:25:02
character controller unity crouch
#pragma strict private var ch : CharacterController; private var startHeight : float; // initial height function Start() { ch = GetComponent(CharacterController); startHeight = ch.height; } function Update() { var newH : float = startHei... Add solution -
Python 2022-03-24 22:35:23
turtle circle() python
import turtle t = turtle.Turtle() t.color(color) # choose a color t.begin_fill() # if you want it to be filled with color later t.circle(10) # the function "circle" and the radious. t.end_fill() # completing the filling of the circle. # try to ... Add solution -
Javascript 2022-03-24 20:40:11
javascript format date yyyy-mm-dd hh:mm:ss to dd-mm-yyyy hh:mm am/pm
dateString = '2020-04-03 20:30:55'; function formatDate(dateString) { var allDate = dateString.split(' '); var thisDate = allDate[0].split('-'); var thisTime = allDate[1].split(':'); var newDate = [thisDate[2],thisDat... Add solution -
SQL 2022-03-24 19:45:27
How to use node-mysql without loads all the rows into the memory? Ask Question
const mysql = require('mysql'); const stream = require('stream'); connection.query('SELECT * FROM `bigdata`') .on('error', function(err) { // Do something about error in the query }) .stream() // Stream allows you to get records one-by-one .p... Add solution -
Javascript 2022-03-24 18:20:03
write custom validation in mongoose
const schema = new Schema({ name: { type: String, required: true } }); const Cat = db.model('Cat', schema); // This cat has no name :( const cat = new Cat(); cat.save(function(error) { assert.equal(error.errors['name'].message, 'Path `n... Add solution -
Html 2022-03-24 15:55:29
google map html
<script> function myMap() { var mapProp= { center:new google.maps.LatLng(51.508742,-0.120850), zoom:5, }; var map = new google.maps.Map(document.getElementById("googleMap"),mapProp); } </script> <script src="[Google API ... Add solution