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 foo = function() { | |
var a = 3, b = 5; | |
console.log("a: " + a + ", b: " + b); | |
if (typeof c === "undefined") { console.log("c is undefined"); } | |
console.log("---"); | |
var bar = function() { | |
var b = 7, c = 11; | |
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
File.foreach('URLS.txt') { |l| | |
system("curl -sL -w '%{http_code} %{url_effective}\\n' '#{l.chomp}' -o /dev/null") | |
} |
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 myFunction() { | |
var response = UrlFetchApp.fetch("http://www.example.com/get-modx-latest-version.php"); | |
SpreadsheetApp.getActiveSheet().getRange('A1').setValue(response.getContentText()); | |
} |
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 x = $(".content").find("a").each( | |
function(){ | |
var href = $(this).attr("href"); | |
if((!$(this).hasClass("drowsapMorphed")) && ($(this).next(".drowsapMorphed").length==0) && href && (href.indexOf('imgur')>=0 || href.indexOf('jpeg')>=0 || href.indexOf('jpg')>=0 || href.indexOf('png')>=0)){ | |
var ext = (href.indexOf('imgur')>=0 && href.indexOf('jpg')<0 && href.indexOf('png')<0) ? '.jpg' :''; | |
var img = $("<a class='drowsapMorphed' href='"+href+"' target='blank' style='display:block'><img style='display:block;max-width:780px;' src='"+href+ ext+"' /></a>"); | |
$(this).after(img); | |
} | |
} | |
); |
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
module Harmony | |
# Allows accessing config variables from harmony.yml like so: | |
# Harmony[:domain] => harmonyapp.com | |
def self.[](key) | |
unless @config | |
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
end | |
@config[key] | |
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
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Scrub sensitive parameters from your log | |
# filter_parameter_logging :password | |
before_filter :log_page_view, :except => [:destroy] | |
private |
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
/* Quick and easy way to make a webpage look good on an iPhone */ | |
<style type="text/css" media="only screen and (max-device-width: 480px)"> | |
body { width:90%; padding-right:0;} | |
h1 { margin-top:25px; } | |
p { width: 100%; } | |
</style> | |
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.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
require 'rubygems' | |
require 'faker' | |
require 'Win32API' | |
require 'win32/clipboard' | |
include Win32 | |
=begin | |
= Lorem ipsum clipboard text for Windows | |
If you're using Windows and a quick launcher (like Launchy) you can use this script | |
to generate a paragraph of 'Lorem ipsum...' text and automatically copy it to your |
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 'Win32API' | |
require 'win32/clipboard' | |
include Win32 | |
text = Clipboard.data | |
=begin | |
= Ruby script to remove crummy 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
awake: awoke | |
be: was | |
bear: bore | |
beat: beat | |
become: became | |
begin: began | |
bend: bent | |
beset: beset | |
bet: bet | |
bid: bid/bade |
OlderNewer