This file contains hidden or 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
ConvertToCSV = (objArray,name) -> | |
array = if typeof objArray isnt "object" then JSON.parse objArray else objArray | |
str = "" | |
for item,i in array | |
line = "#{array[i]["date"]}, #{commaReplace name}" | |
for index of array[i] | |
if index isnt "date" | |
line += ", #{commaReplace array[i][index]}" | |
str += line + "\r\n" | |
str |
This file contains hidden or 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
#b64_sha1 library used in this code is Base64 encode / decode from http://www.webtoolkit.info/ | |
localStoreset= (objectName, newobject) -> | |
bytes=new air.ByteArray() | |
bytes.writeUTFBytes(newobject) | |
air.EncryptedLocalStore.setItem(objectName, bytes) | |
getSecretInfoFromSS = (user,pass)-> | |
datatext = "encryptedPassword=#{encodeURIComponent(b64_sha1(pass))}&loginStyle=regular&SS_CHAIN_TO_ACTION=http%3A%2F%2WebpageToRedirectToWithSecrets%2Frelogin=true&username=#{user}" | |
This file contains hidden or 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
$('#InputText').on 'change', -> | |
inputText = $(@) | |
$.ajax("http://localhost:8888/chat?from=#{$('#Name').val()}&content=#{inputText.val()}") | |
inputText.val('') | |
pusher = new Pusher('Get Your Own Key at Pusher.com') | |
channel = pusher.subscribe('ChatChannel') | |
channel.bind('chat', (data)->$('#OutputText').prepend("#{data.from} said #{data.content} <br>")) |
This file contains hidden or 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
http = require 'http' | |
url = require 'url' | |
pusher = require 'node-pusher' | |
mykey = 'Get Your Own Key at Pusher.com' | |
mysecret = 'Get Your Swn Secret' | |
myappid = 'Get Your Own App' | |
myPusher = new pusher( | |
appId: myappid |
This file contains hidden or 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
$ -> | |
$.ajax | |
url:"/member/#{Squarespace.Constants.AUTHENTICATED_USER_LOGIN}" | |
success: (data) -> | |
email = $(data).find('#email').val() | |
console.log(email) | |
# do something more interesting |
This file contains hidden or 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 geturls($url) { | |
$apikey=PL_Options::get('placester_api_key'); | |
$urls = array( | |
image => 'https://api.placester.com/v2/listings/media/temp/image?api_key=' . $apikey, | |
listing => 'https://api.placester.com/v2/listings?api_key=' . $apikey, | |
); | |
return $urls[$url]; |
This file contains hidden or 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 matt_listing_method($return,$raw,$html){ | |
$location = $raw['location']; | |
$cur_data = $raw['cur_data']; | |
$uncur_data = $raw['uncur_data']; | |
?> | |
<div class="listing"> | |
<span>Address: <?php echo $location['address'].', '.$location['locality'].', '.$location['region'].' '.$location['postal'] ?></span> | |
<a href="<?php echo $cur_data['url'] ?>">Click Here to View Property</a> | | |
<a href="https://maps.google.com/maps?q=<?php echo $location['full_address'] ?>&hl=en&z=15<br />">View on a map</a> |
This file contains hidden or 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
<div class="search-item"> | |
<label>Neighborhoods:</label> | |
<select id=hoodselect name='hood-select'> | |
<option value="">Any</option> | |
</select> | |
</div> | |
<div class="search-item"> | |
<label>Min Beds:</label>[min_beds] | |
</div> | |
<div class="search-item"> |
This file contains hidden or 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 | |
/** | |
* Template Name: SliderTest | |
*/ | |
wp_enqueue_style( 'royal_slider_css', get_template_directory_uri() . "/royalslider/royalslider.css"); | |
wp_enqueue_style( "royal_slider_default_skin_css", get_template_directory_uri() . "/royalslider/skins/default/rs-default.css" ); | |
wp_enqueue_script( "royal_slider_js", get_template_directory_uri() . "/royalslider/jquery.royalslider.min.js"); | |
get_header( ); |
This file contains hidden or 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 dogapi import dog_http_api as api | |
api.api_key = 'YOUR_API_KEY' | |
api.application_key = 'YOUR_APPLICATION_KEY' | |
# Submit a single point with a timestamp of `now` | |
api.metric('page.views', 1000) | |
#see more examples here: http://docs.datadoghq.com/api/ |
OlderNewer