Skip to content

Instantly share code, notes, and snippets.

View bokinga's full-sized avatar

Bokinga bokinga

View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@jcanfield
jcanfield / .gitconfig
Created August 3, 2012 03:52
GIT Invoice
## GIT Configuration
## Local found at `~/.gitconfig`
## Installation: Add snippet to .gitconfig file
## Usage: `git invoice` to list recent commits in "pretty format"
## Credit: @svizion (http://twitter.com/svizion)
[alias]
invoice = log --pretty=format:'%ad - %s' --abbrev-commit --date=short
@earlonrails
earlonrails / toggle.js
Last active December 23, 2017 18:24
pure javascript version of jQuery's toggle. Now with show and hide! Yay!
HTMLElement.prototype.show = function(){
this.style.display = '';
}
HTMLElement.prototype.hide = function(){
this.style.display = 'none';
}
HTMLElement.prototype.toggle = function(){
if (this.style.display == 'none'){
/*************************************************
* This is a simple Monte Carlo simulation to see
* whether we should
* go for X BIG deal and/or Y SMALL deals.
*
* What is the best blend?
*
* Author: Ido Green | plus.google.com/+greenido
* Date: 16 July 2013
*
@stonehippo
stonehippo / install_ruby_with_rbenv.md
Last active June 14, 2024 00:32
Installing a new Ruby with rbenv on Mac OS

Install a new Ruby with rbenv on Mac OS (and make yourself a superhero)

If you're doing stuff with Ruby on a Mac, e.g. installling Jekyll or something, by default you'll end up having to use the sudo command to do stuff, since the permission to modify the default config is not available to your user account.

This sucks and should be avoided. Here's how to fix that.

Installing a new Ruby

To make this better, we are going install a new, custom Ruby. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*

A word of warning: you will have to use Terminal to install this stuff. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. But if that's the case, I'm not sure why you were trying to use Ruby in the first place.

@arun99178
arun99178 / jack-in-the-box-init.js
Created November 9, 2015 11:18 — forked from srikat/jack-in-the-box-init.js
Scroll animations in WordPress using Animate.css, Jack In The Box and Waypoints. http://sridharkatakam.com/scroll-animations-wordpress-using-animate-css-jack-box-waypoints/
jQuery(function() {
@warking
warking / install_linuxbrew_on_centos7.sh
Last active August 19, 2023 19:26
standalone linuxbrew setup script for CentOS 7
# Non-root account is recommended for this process
# centos-specific prepration
sudo yum -y update && sudo yum -y groupinstall 'Development Tools' && sudo yum -y install curl irb m4 ruby
# Sanitize the environment
PATH=~/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
unset LD_LIBRARY_PATH PKG_CONFIG_PATH
# install linuxbrew

Electron Drag’n’Drop

Allows files(s) to be dragged inside the electron app as well as files to be dropped out (when dropped on the desktop e.g. the file will be copied to the destination.

Installation

Clone the Quick Start repository:
git clone https://github.com/electron/electron-quick-start

Go into the repository:

@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@andrewstobbe
andrewstobbe / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Last active July 19, 2021 02:12
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions