To setup your computer to work with *.locahost domains, e.g. project.localhost, awesome.localhost and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> Catalina
#!/bin/bash | |
# Log function to print messages to stdout and stderr | |
function log { | |
if [ $1 == "success" ]; then | |
echo -e "\033[32m[`date +'%Y-%m-%d %H:%M:%S'`] $2\033[0m" | |
else | |
echo -e "\033[31m[`date +'%Y-%m-%d %H:%M:%S'`] $2\033[0m" >&2 | |
fi | |
} |
To setup your computer to work with *.locahost domains, e.g. project.localhost, awesome.localhost and so on, without having to add to your hosts file each time.
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
List() | |
var list = Immutable.List([1,2,3]) | |
// [1, 2, 3] | |
List.isList() | |
Immutable.List.isList(list) | |
// true | |
List.of() | |
var list = Immutable.List.of(1,2,3); |
<!-- Example #1 - no styling --> | |
Made with ❤ in Switzerland | |
<!-- Example #2 - inline-styled ❤ --> | |
Made with <span style="color: #e25555;">♥</span> in Switzerland | |
Made with <span style="color: #e25555;">♥</span> in Switzerland | |
<!-- Example #3 - CSS-style class for ❤ --> | |
<style>.heart{color:#e25555;}</style> | |
Made with <span class="heart">❤</span> in Switzerland |
#include<stdio.h> | |
int is_prime(int num) | |
{ | |
if (num <= 1) return 0; | |
if (num % 2 == 0 && num > 2) return 0; | |
for(int i = 3; i < num / 2; i+= 2) | |
{ | |
if (num % i == 0) | |
return 0; |
#include<stdio.h> | |
int main() | |
{ | |
int y,i,num; | |
printf("Enter the number of integers you need:"); | |
scanf(" %d", &y); | |
int r1[y]; | |
printf("Enter a number:"); | |
scanf(" %d", &num); | |
for( i=1; i<=y; i++){ |
Include Weather Icons in your app: https://github.com/erikflowers/weather-icons
Include the below JSON in your application, for example purposes, lets assume it's a global named weatherIcons
.
Make a request to OpenWeatherMap:
req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
contract Process_0g28l4d_Contract { | |
uint tokens = 1; | |
uint subprocesses = 0; | |
uint hours_before_checking_72_time = 0; | |
uint Checkout_date_time = 0; | |
function hours_before_checking_72(uint localTokens) internal returns (uint) { | |
hours_before_checking_72_time = now; | |
return localTokens & uint(~2) | 4; | |
} |