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
# In the example here, where three repos are used, the idea is to take advantage of ssh's config mechanism | |
# For use with Jenkins, do the following: | |
# login to your CI Server | |
sudo su -s /bin/bash jenkins | |
cd ~/.ssh/ | |
# then create three key key pairs | |
ssh-keygen -f id_rsa_project1 | |
# on prompt, set target file to id_rsa_project1 | |
# repeat for id_rsa_project2 and id_rsa_project3 |
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
<html> | |
<head> | |
<style type="text/css" media="screen"> | |
input { | |
display: block; | |
margin-top: 10px; | |
} | |
#modal { | |
background-color: #affdc2; |
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
# WARNING: This is just a workaround. Consider it as a very | |
# temporary solution if you really need this feature. | |
from django.utils.safestring import mark_safe | |
from django_select2.util import convert_to_js_arr | |
TEMPORARY_ID = 0 | |
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 | |
// no direct access | |
defined('_JEXEC') or die; | |
// Variables | |
$doc = JFactory::getDocument(); | |
$user = JFactory::getUser(); | |
$template = 'templates/' . $this->template; | |
// get html head data |
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
tell application "Finder" | |
try | |
set appPath to (path to application "Evernote" as text) | |
on error | |
display dialog "Couldn't find Evernote. Is it installed?" | |
end try | |
set printPath to (path to "dlib" from user domain as text) & "PDF Services" | |
make new alias at printPath to appPath with properties {name:"Send PDF to Evernote"} | |
end tell |
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/sh | |
################################################################################ | |
# DEFAULT VARIABLES | |
################################################################################ | |
LOCAL_PATH=/var/www | |
LOCAL_DOMAIN=mylocaltest.dev | |
LOCAL_DB_NAME=myuser | |
LOCAL_DB_USER=root | |
LOCAL_DB_PASSWORD=myrootpassword |
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
SELECT m.id, m.title, | |
@tmp_search := '"menu-meta_description":"' AS tmp_search, | |
@tmp_search_len := LENGTH(@tmp_search) AS tmp_search_len, | |
@start := LOCATE(@tmp_search, m.params) AS tmp_start, | |
@end := LOCATE('"', m.params, @start + @tmp_search_len) AS tmp_end, | |
SUBSTRING(m.params, @start + @tmp_search_len, @end - @start - @tmp_search_len) AS metadesc, | |
@tmp_search := '"page_title":"' AS tmp_search, | |
@tmp_search_len := LENGTH(@tmp_search) AS tmp_search_len, | |
@start := LOCATE(@tmp_search, m.params) AS tmp_start, |
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
$json_errors = array( | |
JSON_ERROR_NONE => 'No error has occurred', | |
JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', | |
JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', | |
JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded', | |
JSON_ERROR_SYNTAX => 'Syntax error', | |
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded (PHP 5.3.3)', | |
JSON_ERROR_RECURSION => 'One or more recursive references in the value to be encoded (PHP 5.5.0)', | |
JSON_ERROR_INF_OR_NAN => 'One or more NAN or INF values in the value to be encoded (PHP 5.5.0)', | |
JSON_ERROR_UNSUPPORTED_TYPE => 'A value of a type that cannot be encoded was given (PHP 5.5.0)' |
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
/** | |
* @package MyPlugin | |
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL | |
*/ | |
/* global Wistia */ | |
Wistia.plugin('myplugin', function(video) { | |
// Wait for the video element to be fully loaded | |
interval = setInterval(function() { | |
// Your magic goes here |