Skip to content

Instantly share code, notes, and snippets.

@madindo
madindo / PHP Countries Array
Created Dec 13, 2016 — forked from DHS/PHP Countries Array
PHP array of all country names
View PHP Countries Array
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island
@madindo
madindo / unix_to_datestamp.js
Created Aug 27, 2014
Unix to datestamp javascript
View unix_to_datestamp.js
var theDate = new Date(content.publish_date * 1000);
var date = theDate.getDate();
var month = theDate.getMonth() + 1;
var month = month < 10 ? '0' + month : month ; //Months are zero based
var year = theDate.getFullYear();
var hour = theDate.getHours();
var min = theDate.getMinutes();
var sec = theDate.getSeconds();
console.log(year + "-" + month + "-" + date + " " + hour + ":" + min + ":" + sec);