Skip to content

Instantly share code, notes, and snippets.

@EddyRespondek
EddyRespondek / css3-slider
Created January 10, 2014 03:27
Pure CSS3 slider.
<html>
<style>
.wrapper {
width: 100%;
}
.main {
min-width: 320px;
max-width: 1200px;
@EddyRespondek
EddyRespondek / 0_reuse_code.js
Created February 19, 2014 22:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@EddyRespondek
EddyRespondek / javascript_resources.md
Created February 19, 2014 22:29 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
on run {input, parameters}
set output to {}
repeat with f in input
set f to replace(POSIX path of f, "/Volumes/", "afp://myserver/")
set f to replace(f, " ", "%20")
set end of output to f
end repeat
set text item delimiters to linefeed
set the clipboard to (output as text)
end run
@EddyRespondek
EddyRespondek / wordpress_domain_replace.sql
Created June 12, 2014 23:10
Wordpress change domain name
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
@EddyRespondek
EddyRespondek / poll_element_loaded.js
Created June 17, 2014 06:14
Polls for element creation and then loads a new script. Could be used for just about anything including checking for external file loading. Note: there is also MutationObserver but couldn't find anything reliable. https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
var poll;
var timeout = 100; // gives up after 10 seconds
poll = function () {
setTimeout(function () {
timeout--;
if ( $('#myid').length === 1 ) {
var script= document.createElement('script');
script.type = 'text/javascript';
<?php
if ( !class_exists( 'GFForms' ) || !defined( 'WPINC' ) ) {
return;
}
class BTFunds {
/**
* Dashboard-only initialization.
*/
@EddyRespondek
EddyRespondek / wp-permalink-structure-A.php
Last active August 29, 2015 14:07
Wordpress permalink structure
<html>
<head>
<title></title>
<script src="jquery.min.js"></script>
<script type='text/javascript' src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.1/jquery.xdomainrequest.min.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script>
<script type="text/javascript">
<?php
add_action("gform_pre_submission_filter", "after_submission", 10, 2);
function after_submission($form) {
//only process if this is the profile details form
if($form["id"] == 12) {
//save data and notify admin that data has been updated.