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
//detect Internet Explorer and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
//version arg is for IE version (optional) | |
//comparison arg supports 'lte', 'gte', etc (optional) | |
var isIE = (function(undefined){ | |
var doc = document, | |
doc_elem = doc.documentElement, | |
cache = {}, |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
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
/* Based on | |
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co> | |
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1) | |
*/ | |
var ExcelFormulas = { | |
PVIF: function(rate, nper) { | |
return Math.pow(1 + rate, nper); | |
}, |
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
<!doctype html> | |
<html ng-app="Demo" ng-controller="AppController"> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Lazy Loading Images With AngularJS | |
</title> | |
<style type="text/css"> |
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 'formula' | |
class UniversalPython < Requirement | |
satisfy(:build_env => false) { archs_for_command("python").universal? } | |
def message; <<-EOS.undent | |
A universal build was requested, but Python is not a universal build | |
Boost compiles against the Python it finds in the path; if this Python | |
is not a universal build then linking will likely fail. |
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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
# Idea of : Thibault (@EyeWriteCode) | |
require 'Twitter' #gem install twitter | |
begin | |
# Create a read application from : | |
# https://apps.twitter.com | |
# authenticate it for your account | |
# fill in the following | |
config = { |
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
#!/usr/bin/env ruby | |
require 'pygmentize' # gem install pygmentize | |
require 'selenium-webdriver' # gem install selenium-webdriver | |
exit unless code_path = ARGV.shift | |
file_path = File.absolute_path 'code.html' | |
image_path = File.absolute_path 'code_image.png' | |
code = Pygmentize.process File.read(code_path), :ruby | |
html = <<-EOT |
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
CREATE TABLE IF NOT EXISTS `county` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`name` varchar(124) NOT NULL, | |
`short_name` varchar(20) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; | |
INSERT INTO `county` (`id`, `name`, `short_name`) VALUES |
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 moscow = [ | |
[[55.82526701551843,37.87487898420691], | |
[55.825342,37.87566605844205], | |
[55.82490198590066,37.876002], | |
[55.82286899363699,37.86894202090486], | |
[55.82236197619592,37.869207025558865], | |
[55.82221,37.868321941252766], | |
[55.82370199523918,37.867472], | |
[55.825242976516364,37.874401949797814], | |
[55.82526701551843,37.87487898420691]], |
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 Photo < ActiveRecord::Base | |
module Statues | |
QUEUED = 'queued' | |
NEW = 'new' | |
def self.values | |
constants.map(&method(:const_get)) | |
end | |
# you can define more special methods as you wanted for Statues | |
end |
OlderNewer