Skip to content

Instantly share code, notes, and snippets.

View clintonhalpin's full-sized avatar
✌️

Clinton Halpin clintonhalpin

✌️
View GitHub Profile
@clintonhalpin
clintonhalpin / SnippetFile
Created July 14, 2012 20:16
Search and Replace DB
update {table_name} set {column} = replace({column}, ‘{text to replace}’, ‘{replace with}’)
@clintonhalpin
clintonhalpin / SnippetFile
Created July 14, 2012 20:22
Html Basic Structure
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Seems to be a good standard...but whatever-->
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1.0, user-scalable=no">
<title>Panelfly - Home</title>
<meta name="author" content="#Big Pun" />
@clintonhalpin
clintonhalpin / SnippetFile
Created July 18, 2012 22:44
Search and Replace DB
update sample_table_name set data = replace(data, ‘jpg ’, ‘jpg’)
--
update {table_name} set {column} = replace({column}, ‘{text to replace}’, ‘{replace with}’)
@clintonhalpin
clintonhalpin / user-login.php
Created August 11, 2012 20:50
Determine if users logged in, Serve different content
<?php
/*
Determine User Status and Change Content based on login
*/
get_currentuserinfo();
global $user_ID, $user_login;
//Not Logged In go where ever
@clintonhalpin
clintonhalpin / gist:3658703
Created September 6, 2012 17:18
Terminal for Designers
Terminal for Designers
CD ( move around directories )
ex. move to - cd desktop
ex. backout - cd ..
===
<h1>Cut some images?</h1>
@clintonhalpin
clintonhalpin / baseline.less
Created September 24, 2012 03:58
Less Baseline Variables
@baseline: 6px;
@baseline_x2: @baseline * 2;
@baseline_x3: @baseline * 3;
@baseline_x4: @baseline * 4;
@baseline_x6: @baseline * 6;
@baseline_x8: @baseline * 8;
@baseline_x10: @baseline * 10;
@baseline_x12: @baseline * 12;
@clintonhalpin
clintonhalpin / email.php
Created May 19, 2013 15:11
Send HTML Email in PHP
<?php
$to = 'clintonhalpin@gmail.com';
$name = 'Clinton Halpin';
$subject = 'Purchase Successful!';
$message = '<html><head><title>Purchase Successful!</title></head><body><h1>' . $name . '</h1></body></html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
@clintonhalpin
clintonhalpin / connect.js
Created July 31, 2013 17:47
Node Mongo Connection
var mongo = require('mongodb');
var Server = mongo.Server,
Db = mongo.Db,
BSON = mongo.BSONPure;
var server = new Server('localhost', 27017, {auto_reconnect: true});
db = new Db('itemsdb', server, {safe: true});
@clintonhalpin
clintonhalpin / connect.js
Created July 31, 2013 17:47
Node Mongo Connection
var mongo = require('mongodb');
var Server = mongo.Server,
Db = mongo.Db,
BSON = mongo.BSONPure;
var server = new Server('localhost', 27017, {auto_reconnect: true});
db = new Db('itemsdb', server, {safe: true});