Some vanilla equivalents to jQuery methods.
jQuery:
(function( $ ){ | |
/* | |
A cleaner approach to jquery plugins. Separate the code for the plugin's functionality from | |
the assignment into the jQuery namespace. | |
Taken from various articles/presos by Alex Sexton and Paul Irish, and #jquery IRC chats. | |
With enthusiasm for Object.create() toned down after http://news.ycombinator.com/item?id=2594521 | |
*/ |
' Q B a s i c G o r i l l a s | |
' | |
' Copyright (C) IBM Corporation 1991 | |
' | |
' Your mission is to hit your opponent with the exploding banana |
// Maintain ratio mixin. Great for responsive grids, or videos. | |
// https://gist.github.com/brianmcallister/2932463 | |
// | |
// $ratio - Ratio the element needs to maintain. | |
// | |
// Examples | |
// | |
// // A 16:9 ratio would look like this: | |
// .element { | |
// @include maintain-ratio(16 9); |
jQuery(document).ready(function($){ | |
$('h2.title').html(function(){ | |
// separate the text by spaces | |
var text= $(this).text().split(' '); | |
// drop the last word and store it in a variable | |
var last = text.pop(); | |
// join the text back and if it has more than 1 word add the span tag | |
// to the last word | |
return text.join(" ") + (text.length > 0 ? ' <span class="last">'+last+'</span>' : last); |
// Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL | |
// بررسی صحت کد ملی ایران - کلوژر، سیشارپ، افشارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پیاچپی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، ویبی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مایاسکیوال | |
// در نسخههای قبل یکسان بودن اعداد نا معتبر تشخیص داده میشد ولی | |
// اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد | |
// بعضی از پیادهسازیها سریع نیستند، میتوانید نسخهٔ خود را بر پایهٔ | |
// نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد | |
/** |
# Apache configuration file | |
# httpd.apache.org/docs/2.2/mod/quickreference.html | |
# Note .htaccess files are an overhead, this logic should be in your Apache | |
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html | |
# Techniques in here adapted from all over, including: | |
# Kroc Camen: camendesign.com/.htaccess | |
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
# Sample .htaccess file of CMS MODx: modxcms.com | |
# This is the free sample of .htaccess from 6GO s.r.l. | |
# @author Claudio Ludovico Panetta (@Ludo237) |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('.dragger').mousedown(function (event) { | |
$(this) | |
.data('down', true) | |
.data('x', event.clientX) | |
.data('scrollLeft', this.scrollLeft) | |
.addClass("dragging"); | |
return false; |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Display files sizes next to download links</title> | |
</head> | |
<body> | |
<a href="001.html" class="fetchSize">First Trickshot</a> | |
<a href="034.html" class="fetchSize">This Trickshot</a> | |
<a href="ball.png" class="fetchSize">Ball.png</a> |
/** @jsx React.DOM */ | |
'use strict'; | |
var React = require('react'); | |
var MasonryMixin = require('./react-masonry-mixin.js'); | |
var masonryOptions = { | |
transitionDuration: 0 |