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
/* | |
Expanding color pixels on the current (and only loaded image) | |
*/ | |
var doc = app.documents[0]; | |
doc.colorSamplers.removeAll(); // otherwise it will create an error if there is already a colorSampler on this point | |
var offset = 4; | |
for (var w=0; w < doc.width; w+=offset) { | |
for (var h=0; h < doc.height; h+=offset) { |
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
// ==UserScript== | |
// @name passwordsafe formatting | |
// @namespace jdesrosiers | |
// @description newlines to BR tags | |
// @include https://www.passwordsafe.com/secure/main.html | |
// ==/UserScript== | |
var nl2br = function(value) { | |
return value.replace(/\n/g, "<br />"); | |
} |
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
// ==UserScript== | |
// @name Layout Overlay | |
// @namespace jdesrosiers | |
// @include http://localhost/projectname/* | |
// ==/UserScript== | |
switch ( window.location.href.match(/([^\/]+\.html)$/i)[0] ) { | |
case 'index.html': | |
var mockupImg = 'indexlayout.jpg'; break; | |
case 'about.html': |
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 'rubygems' | |
require 'anemone' | |
load 'global.rb' # contains the skip_links_like regex | |
# get all the html files that we need | |
Anemone.crawl("http://codex.wordpress.org/Function_Reference/") do |anemone| | |
anemone.skip_links_like $regex | |
anemone.on_pages_like /http\:\/\/codex.wordpress.org\/Function_Reference\// do |page| | |
puts page.url | |
matched = page.url.to_s.match /http\:\/\/codex.wordpress.org\/Function_Reference\/([_a-zA-Z0-9]+)$/ |
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 sfwPNG24(saveFile){ | |
var pngOpts = new ExportOptionsSaveForWeb; | |
pngOpts.format = SaveDocumentType.PNG | |
pngOpts.PNG8 = false; | |
pngOpts.transparency = true; | |
pngOpts.interlaced = false; | |
pngOpts.quality = 100; | |
activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:yt="http://gdata.youtube.com/schemas/2007"> | |
<id>http://gdata.youtube.com/feeds/api/videos/NpJMQ6Vebbw</id> | |
<published>2010-12-31T17:12:01.000Z</published> | |
<updated>2010-12-31T17:14:55.000Z</updated> | |
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/> | |
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="People" label="People"/> | |
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="jus"/> | |
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="orange"/> | |
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="oasis"/> |
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
# at the end of video_info_spec.rb ... | |
context "vcr recorded request" do | |
use_vcr_cassette "fixtures/vcr_cassettes/youtube_recorded", :record => :new_episodes | |
it "should have no views to it" do | |
video = VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') | |
video.view_count.should == 0 | |
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
--- | |
- !ruby/struct:VCR::HTTPInteraction | |
request: !ruby/struct:VCR::Request | |
method: :get | |
uri: http://gdata.youtube.com:80/feeds/api/videos/oQ49W_xKzKA | |
body: | |
headers: | |
response: !ruby/struct:VCR::Response | |
status: !ruby/struct:VCR::ResponseStatus | |
code: 200 |
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
if has("terminfo") | |
set t_Co=16 | |
set t_AB=[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm | |
set t_AF=[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm | |
else | |
set t_Co=16 | |
set t_Sf=[3%dm | |
set t_Sb=[4%dm | |
endif |
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
montant = ARGV[0].to_f | |
TPSpercent = 5 | |
TVQpercent = 8.5 | |
myTPS = montant * TPSpercent / 100 | |
myTVQ = (montant + myTPS) * TVQpercent / 100 | |
total = montant + myTPS + myTVQ | |
puts total.round(2) |
OlderNewer