Skip to content

Instantly share code, notes, and snippets.

View bdsexton's full-sized avatar

Brian Sexton bdsexton

View GitHub Profile
@JohnnyQQQQ
JohnnyQQQQ / draganddrop.js
Last active December 12, 2015 09:29
simple snippet and demo for a drag and drop motion in casperjs
var casper = require('casper').create();
casper.start();
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');
casper.viewport(1024, 768);
casper.thenOpen('http://jsbin.com/ifuma#noedit', function() {
this.capture('test.png');
@getify
getify / gist:675496
Created November 13, 2010 17:18
detecting if flash plugin is installed
var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));
@ihor
ihor / mysql-init.d-macos.sh
Last active July 13, 2018 19:27
/etc/init.d/mysql script for Homebrew installed MySQL
#!/bin/bash
DAEMON=/usr/local/bin/mysqld_safe
OPTS=--defaults-file=/usr/local/etc/mysql/my.cnf
NAME=mysql
DESC=mysql
test -x $DAEMON || exit 0
set -e
@cristianciofu
cristianciofu / phpDateTimeMondayFirstDay.php
Created June 22, 2013 10:48
Change php's DateTime behavior to use Monday as first day of the week
<?php
// found it here :
// http://stackoverflow.com/questions/13128854/php-datetime-class-change-first-day-of-the-week-to-monday
class EuroDateTime extends DateTime {
// Override "modify()"
public function modify($string) {
@fideloper
fideloper / usevm.md
Created June 6, 2012 02:24
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

@frankleromain
frankleromain / 403forbidden.php
Created April 14, 2012 20:25
Creating a Secure PHP Login Script
<?php
header('HTTP/1.1 403 Forbidden');
?>
<html>
<head>
<title>Congratulations! You have been DENIED access</title>
</head>
<body>
<font size="4">You have been denied access because of the following reasons:<br /><br />
1.) Too many failed login attempts, so you are likely brute forcing through logins.<br />
@yang-wei
yang-wei / fullscreen.css
Last active February 6, 2023 23:50
Full size background image using CSS cover in mobile devices
html {
background: url(image url) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
overflow: hidden;
}
@toddmotto
toddmotto / *.md
Last active April 25, 2023 09:06
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
@binary1230
binary1230 / wells fargo website bulk statement downloader
Last active November 14, 2023 02:22
wells fargo ability to download all bank statements
3/18/2021: WE HAVE MOVED: For the latest instructions on how to use the bulk wells fargo PDF downloader,
please ignore this page and visit below:
https://github.com/binary1230/wellsfargo-bulk-PDF-statement-downloader/blob/main/README.md
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying