This file contains 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
/** | |
* PetController | |
* | |
* @description :: Server-side logic for managing pets | |
* @help :: See http://links.sailsjs.org/docs/controllers | |
*/ | |
module.exports = { | |
index: function (req,res) { | |
This file contains 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
scriptencoding utf-8 | |
let s:calendar_list = [ | |
\ ['Australian Holidays', 'en.australian#[email protected]'], | |
\ ['Austrian Holidays', 'en.austrian#[email protected]'], | |
\ ['Brazilian Holidays', 'en.brazilian#[email protected]'], | |
\ ['Canadian Holidays', 'en.canadian#[email protected]'], | |
\ ['China Holidays', 'en.china#[email protected]'], | |
\ ['Christian Holidays', 'en.christian#[email protected]'], | |
\ ['Danish Holidays', 'en.danish#[email protected]'], |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
/* | |
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers | |
* | |
* (C) 2010, Nodejitsu Inc. | |
* (C) 2011, Cull TV, Inc. | |
* | |
*/ | |
var base64 = exports; |
This file contains 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 | |
function indexed($url) { | |
$url = 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode($url); | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
curl_setopt($ch, CURLOPT_NOBODY, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10'); | |
This file contains 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 get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |
This file contains 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
#!/usr/bin/env php | |
<?php | |
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page | |
set_time_limit(0); | |
$dir = $argv[1]; | |
$source = $argv[2]; | |
print_r($argv); | |
mkdir ($dir); | |
$src = file_get_contents($source); | |
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i'; |
This file contains 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 | |
/* | |
This code snippet can be added to your functions.php file (without the <?php) | |
to add a query string to the login link emailed to the user upon registration | |
which when clicked will validate the user, log them in, and direct them to | |
the home page. | |
*/ | |
/** | |
* This first function is hooked to the 'user_register' action which fires |
This file contains 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
#!/bin/bash | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
apt-get update | |
apt-get install -y docker-engine | |
systemctl enable docker | |
usermod -aG docker ubuntu | |
curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" | |
chmod +x /usr/local/bin/docker-compose | |
docker-compose -v |
This file contains 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
FROM php:7.0.4-fpm | |
RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
mysql-client libmagickwand-dev --no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-install mcrypt pdo_mysql |
OlderNewer