Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🧐
I may be slow to respond.

Chris Baughman cmbaughman

🧐
I may be slow to respond.
View GitHub Profile
@nicooprat
nicooprat / output.css
Created April 24, 2014 22:45
Vendor prefix mixin for LESS
/* It should output something like this... Easy ! */
.test {
animation: pulse 0.5s 1 both;
-ms-animation: pulse 0.5s 1 both;
-moz-animation: pulse 0.5s 1 both;
-webkit-animation: pulse 0.5s 1 both;
-o-animation: pulse 0.5s 1 both;
transition: all 0.25s;
@elbuo8
elbuo8 / app.yml
Last active August 29, 2015 14:00
Go AppEngine Post
application: your-app-name
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
@gosukiwi
gosukiwi / plugin.jquery.js
Last active August 29, 2015 14:00
jQuery plugin boilerplate
/*
* Minimal tooltip for jQuery by Federico Ramirez
*
* Usage: $('#myElement').myPlugin({});
* $('#myElement').myPlygin('myMethod', arg1, arg2);
* */
;(function ($, window, document, undefined) {
'use strict';
var pluginName = 'myPlugin',
@cmbaughman
cmbaughman / search.txt
Created January 13, 2015 23:38
Find FTP interesting info in github.
extension:conf ftp server configuration
extension:pem private
extension:xls mail
extension:sql mysql dump
# search for backdoor
stars:>1000 forks:>100 extension:php "eval(preg_replace("
@cmbaughman
cmbaughman / osx-for-pentesting.sh
Last active October 15, 2016 17:26 — forked from gabemarshall/osx-for-pentesting.sh
A fork of osx-for-hackers for my personal pentesting setup preferences
# OSX for Pentesting (Mavericks/Yosemite)
#
# A fork of OSX for Hackers (Original Source: https://gist.github.com/brandonb927/3195465)
#!/bin/sh
# Ask for the administrator password upfront
echo "Have you read through the script prior to running this? (y or n)"
read bcareful

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@cmbaughman
cmbaughman / query.cls
Last active May 11, 2017 06:01
Salesforce Apex Query with Wildcard
public static String getAllQuery(String query) {
String result = '';
String regex = '^select\\s+\\*\\s*(?:,\\s*[^\\s]+\\s*)*\\s+from\\s+([^\\s]+)(.*)$';
Matcher m = Pattern.compile(regex).matcher(query.toLowerCase());
if(m.matches()) {
String sObjectName = m.group(1);
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(sObjectName);
Map<String, Schema.SObjectField> fieldMap = targetType.getDescribe().fields.getMap();
@cmbaughman
cmbaughman / gulp-drupal-theme
Created July 1, 2017 22:34 — forked from zetagraph/gulp-drupal-theme
gulp drupal theme
var gulp = require("gulp");
var sass = require("gulp-sass");
var filter = require('gulp-filter');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require("browser-sync");
var reload = browserSync.reload;
var shell = require('gulp-shell');
// sass task
gulp.task('sass', function () {
@cmbaughman
cmbaughman / drupal8.preinstall.mysql.sql
Created July 19, 2017 17:36
Create Drupal 8 Database MySQL
CREATE DATABASE database CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER username@localhost IDENTIFIED BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';
@jacobwise
jacobwise / Advanced Custom Fields and JSON API
Last active November 1, 2017 13:11
How to add Advance Custom Fields to the JSON API in WordPress.
<?php
add_filter('json_api_encode', 'json_api_encode_acf');
function json_api_encode_acf($response)
{
if (isset($response['posts'])) {
foreach ($response['posts'] as $post) {
json_api_add_acf($post); // Add specs to each post
}