Skip to content

Instantly share code, notes, and snippets.

View keinajar's full-sized avatar

Jari Keinänen keinajar

View GitHub Profile
@mathiasbynens
mathiasbynens / toggleAttr() jQuery plugin
Created February 8, 2010 21:20
toggleAttr() jQuery plugin
/*!
* toggleAttr() jQuery plugin
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc…
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
jQuery.fn.toggleAttr = function(attr) {
return this.each(function() {
var $this = $(this);
$this.attr(attr) ? $this.removeAttr(attr) : $this.attr(attr, attr);
@cstrahan
cstrahan / Showdown.as
Created October 27, 2010 10:04
Showdown.as: An AS3 port of John Fraser's showdown.js
// UPDATE: For latest code, see https://github.com/cstrahan/Showdown.as
//
// Showdown.as -- An ActionScript port of showdown.js
//
// Copyright (c) 2010 Charles Strahan.
//
// Original Showdown Copyright (c) 2007 John Fraser.
// <http://attacklab.net/showdown/>
//
// Original Markdown Copyright (c) 2004-2005 John Gruber
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@pocmo
pocmo / netbeans_php_colors.xml
Created April 18, 2011 14:10
Netbeans like PHP colors for IntelliJ IDEA 10
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="netbeans_php_colors" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Monospaced" />
<colors />
<attributes>
<option name="CUSTOM_LINE_COMMENT_ATTRIBUTES">
<value>
<option name="FOREGROUND" value="808080" />
@slevithan
slevithan / xregexp-lookbehind2.js
Created April 14, 2012 21:06
Simulating lookbehind in JavaScript (take 2)
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp.
// Captures within lookbehind are not included in match results. Lazy
// repetition in lookbehind may lead to unexpected results.
(function (XRegExp) {
function prepareLb(lb) {
// Allow mode modifier before lookbehind
var parts = /^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*)\)$/.exec(lb);
return {
@ashsmith
ashsmith / .gitignore
Last active April 22, 2022 00:06
Magento 1.x .gitignore
# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"
app/etc/local.xml
downloader
# If you'd like to keep the downloader, use the following instead:
# downloader/.cache
# downloader/cache.cfg
# downloader/connect.cfg
# All of the var folders can be excluded.
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@pgodino
pgodino / GPUImageMovie.h
Created October 2, 2012 15:06
Play audio with movie
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "GPUImageOpenGLESContext.h"
#import "GPUImageOutput.h"
#import "TPCircularBuffer.h"
#ifndef max
#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif
@brasofilo
brasofilo / old-upload-method.php
Last active October 5, 2018 18:11
Replace the New WP 3.5 Uploader with the Old Thickbox
<?php
/**
* Plugin Name: Old Upload Method
* Plugin URI: http://wordpress.org/support/topic/is-there-a-way-to-disable-the-new-media-manager
* Description: Replace the new media upload with the old thickbox
* Author: A.Morita, brasofilo
* Version: 1.2
* License: GPLv2 or later
*
@jpawlowski
jpawlowski / brew-sync.sh
Last active September 26, 2023 19:54
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*