Skip to content

Instantly share code, notes, and snippets.

View leob's full-sized avatar

leob leob

View GitHub Profile
@siwells
siwells / gist:1114395
Created July 29, 2011 18:19
Use a regex to remove the font tags & their attributes from a page to undo highlighting applied using those self-same font tags
/*
* Clear the highlighting to allow the user to toggle
* between the original page & the highlighted page.
*/
function clearHighlighting()
{
alert("clearing hightlighting...");
if (!document.body || typeof(document.body.innerHTML) == "undefined") {
if (warnOnFailure) {
@anunay
anunay / autoconf-phpize-xampp
Last active July 16, 2021 10:52
Installing AutoConf and Fixing Phpize on OSX 10.9
Installing AutoConf and Fixing Phpize on OSX 10.9
@wozzup
wozzup / gist:9793176
Last active May 22, 2022 14:11
Installing ImageMagick on Mac OSX for PHP and MAMP
Manual Installation
Install Ghostscript
Ghostscript is going to be doing the actual conversion for ImageMagick
`brew install ghostscript
If there is a failure try running brew update and then the command again.
Compile ImageMagick
@Chaser324
Chaser324 / GitHub-Forking.md
Last active June 16, 2024 07:13
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@staltz
staltz / introrx.md
Last active June 17, 2024 07:04
The introduction to Reactive Programming you've been missing
@taivo
taivo / ion-tabs-swipable.js
Created December 16, 2014 02:37
Swipe navigation for ion-tabs (for ionic framework v 1.0.0)
angular.module('yourModule')
.directive('tabsSwipable', ['$ionicGesture', function($ionicGesture){
//
// make ionTabs swipable. leftswipe -> nextTab, rightswipe -> prevTab
// Usage: just add this as an attribute in the ionTabs tag
// <ion-tabs tabs-swipable> ... </ion-tabs>
//
return {
restrict: 'A',
require: 'ionTabs',
@petehouston
petehouston / sync.sh
Created February 19, 2015 06:52
Little script to sync the project/public/ and www/ directory for Laravel 5 deployment
#!/bin/sh
mv www/index.php index.php.saved
rm -rf www/*
# update project/ to your directory name
cp -a project/public/* www
cp project/public/.* www
rm -rf www/index.php
mv index.php.saved www/index.php
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@MatiMenich
MatiMenich / Upload Image Ionic.md
Last active December 1, 2017 18:49
This is a snippet for uploading images using the html5 file input on the device. This will capture the image selected in base64 format, so it can be easly uploaded to a backend.

Upload image using html5 on ionic

This is a snippet for uploading images using the html5 file input on the device. This will capture the image selected in base64 format, so it can be easly uploaded to a backend.

It should trigger something like this:

Image of Html5 image input

view.html

@joecritch
joecritch / MyComponent.js
Last active September 29, 2021 15:16
Passing specific props in React / JSX
class MyComponent extends React.Component {
render() {
const {location, todos, users} = this.props;
//
// ... do things with your variables!
//
return (
<MyChild {...{location, todos, user}} />
// equivalent to:
// <MyChild location={location} todos={todos} user={user} />