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
> [email protected] install /tmp/build_29jklg8iuk0q1/node_modules/hubot/node_modules/node-xmpp/node_modules/node-expat | |
> node-waf configure build | |
> [email protected] install /tmp/build_29jklg8iuk0q1/node_modules/hubot/node_modules/wobot/node_modules/node-xmpp/node_modules/node-expat | |
> node-waf configure build | |
npm ERR! error installing [email protected] Error: Unsupported | |
npm ERR! error installing [email protected] at checkEngine (/tmp/node-npm-77lk/lib/install.js:493:14) | |
npm ERR! error installing [email protected] at Array.0 (/tmp/node-npm-77lk/node_modules/slide/lib/bind-actor.js:15:8) |
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
var AppId = "D8E9ED76519B0D51D42D53256188D00E3A7BB2C2"; | |
var requestStr = "http://api.bing.net/json.aspx?" | |
// Common request fields (required) | |
+ "AppId=" + AppId | |
+ "&Query=<?php the_search_query();?>" | |
+ "&Sources=Spell" | |
// Common request fields (optional) | |
+ "&Version=2.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
class DiceSet | |
def initialize | |
dice = [] | |
end | |
def roll(n) | |
@values = [] | |
for i in (1..n) | |
@values << rand(6) + 1 |
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
list1 = Array.new | |
list2 = Array.new | |
exist = File.open("exist.txt").each_line {|line| list1 << line.gsub(/\s+/, "")} | |
tocheck = File.open("tocheck.txt").each_line {|line| list2 << line.gsub(/\s+/, "")} | |
list2.each do |line| | |
if list1.include?(line) | |
File.open("output.txt", 'w') {|f| f.write(line) } | |
end |
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
<progress min="0" max="100" value="0">0% complete</progress> | |
<script> | |
function upload(blobOrFile) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('POST', '/server', true); | |
xhr.onload = function(e) { ... }; | |
// Listen to the upload progress. |
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 openFullSize(imageURL,imageTitle, pad){ | |
var imgWin = window.open('','_blank','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY); | |
if( !imgWin ) { return true; } //popup blockers should not cause errors | |
imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+ | |
'var pad='+pad+';'+ | |
'function resizeWinTo() {\n'+ | |
'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+ | |
'var oH = document.images[0].height, oW = document.images[0].width;\n'+ | |
'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled | |
'window.doneAlready = true;\n'+ //for Safari and Opera |
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
$(document).on("click", "a:not([data-bypass])", function(evt) { | |
// Get the anchor href and protcol | |
var href = $(this).attr("href"); | |
var protocol = this.protocol + "//"; | |
// Ensure the protocol is not part of URL, meaning its relative. | |
if (href && href.slice(0, protocol.length) !== protocol && href.indexOf("javascript:") !== 0) { | |
// Stop the default event to ensure the link will not cause a page | |
// refresh. | |
evt.preventDefault(); |
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
Find.find('bouclair') do |f| | |
if f.match(/\.html\Z/) | |
file = File.open(f, "w") | |
file.puts('<html><head><meta http-equiv="Refresh" content="0; url=http://www.bouclair.com/" /></head><body><p>Our site has changed! Please follow <a href="http://www.bouclair.com/">this link</a>.</p></body></html>') | |
end | |
end |
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
require 'fileutils' | |
filenames = Dir.glob("*.jpg") | |
filenames.each do |filename| | |
File.rename(filename, filename.gsub(/.jpg/, '') + "fr.jpg") | |
end |
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
delete from groups where group_id in ( | |
select group_id from groups | |
where group_id not in ( | |
select productgroup.groupid from groups | |
inner join productgroup ON groups.group_id = productgroup.groupid | |
) | |
) |
OlderNewer