Skip to content

Instantly share code, notes, and snippets.

@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@kamranzafar
kamranzafar / toast.js
Created July 18, 2012 14:40
JQuery Mobile Android-style Toast popup
var toast=function(msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })
@cschaba
cschaba / gist:4740323
Created February 8, 2013 16:54
PHP: parse output of "df -k"
$data = <<<EOF
Filesystem 1K-blocks Used Available Use% Mounted on
ubi0_0 143180 89740 53440 63% /
tmpfs 64 0 64 0% /dev
tmpfs 143124 76 143048 0% /tmp
tmpfs 4096 912 3184 22% /var
tmpfs 64 0 64 0% /mnt
ubi1_0 468256 12144 456112 3% /opt/data/settings
EOF;
<?php
use PHPUnit_Framework_TestCase as BaseTestCase;
class TestFixer extends BaseTestCase
{
public function fix(&$target, $source, $keep = false) {
if (!$source) {
return;
}
@julionc
julionc / 00.howto_install_phantomjs.md
Last active July 8, 2024 21:44
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@DavertMik
DavertMik / gist:7969053
Created December 15, 2013 04:53
EmailTestCase for testing emails with MailCatcher in PHPUnit
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()
{
@nikushi
nikushi / webpack_dev_server.rb
Last active January 16, 2024 05:10
Rails HMR with rack-proxy and webpack-dev-server, not using Webpacker
# config/initializers/webpack_dev_server.rb
if Rails.development?
Rails.application.config.middleware.use WebpackDevServerProxy, dev_server_host: "localhost:9000"
end