Skip to content

Instantly share code, notes, and snippets.

View miquelbrazil's full-sized avatar

Miquel Brazil miquelbrazil

View GitHub Profile
@jimmynotjim
jimmynotjim / _instructions.md
Last active April 19, 2024 05:26
Setup macOS 12 Monterey

Leaving this for historical reasons, but with the latest iteration I set up proper dotfiles. Check em out

Setup macOS with a Clean Install

After too many years of tinkering my machine is a bit all over. With Mojave High Sierra Montery I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

@benjsicam
benjsicam / netsuite_file_upload_suitelet.js
Last active December 28, 2023 00:00
This code is the File Upload Suitelet for the NetSuite Wizard or NetSuite Assistant which has a File Upload functionality.
/**
* File Upload Suitelet.
* @param {nlobjRequest} request Request object
* @param {nlobjResponse} response Response object
* @returns {Void} Any output is written via response object
*/
function main(request, response) {
if (request.getMethod() == 'GET') {
/* Build the upload form. */
@larrybotha
larrybotha / readme.markdown
Last active March 24, 2025 17:47
Postfix Using Gmail SMTP in Mac OSX Mavericks
@Dynom
Dynom / gist:5866837
Last active December 5, 2017 14:05
Creating ISO 8601-extended in PHP, using DateTime. This includes milliseconds (and if you want, microseconds). Based on the work mentioned here: http://stackoverflow.com/a/4414060/1061927
<?php
// Our input
$time = microtime(true);
// Determining the microsecond fraction
$microSeconds = sprintf("%06d", ($time - floor($time)) * 1000000);
// Creating our DT object
$tz = new DateTimeZone("Etc/UTC"); // NOT using a TZ yields the same result, and is actually quite a bit faster. This serves just as an example.
<?php
App::uses('AppController', 'Controller');
App::uses('Post', 'Model'); //this is important don't forget to add this
/**
* Posts Controller
*
* @property Post $Post
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 22, 2025 02:26
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mmattax
mmattax / oauth2test.php
Last active May 6, 2020 13:30
Formstack OAuth2 Flow
<?php
define('CLIENT_ID', 'YOUR_CLIENT_ID');
define('CLIENT_SECRET', 'YOUR_CLIENT_SECRET');
define('REDIRECT_URL', 'YOUR_REDIRECT_URL'); // for testing, use the URL to this PHP file.
define('AUTHORIZE_URL', 'https://www.formstack.com/api/v2/oauth2/authorize');
define('TOKEN_URL', 'https://www.formstack.com/api/v2/oauth2/token');
if (!empty($_GET['code'])) {
@digitaljhelms
digitaljhelms / gist:4287848
Last active July 7, 2025 14:58
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@antoniofrignani
antoniofrignani / gist:2867440
Created June 4, 2012 09:34
[WP] - Change publish metabox text for custom post type
// http://wpsnipp.com/index.php/functions-php/change-publish-metabox-text-for-custom-post-type/
function wps_translation_mangler($translation, $text, $domain) {
global $post;
if ($post->post_type == 'events') {
$translations = &get_translations_for_domain( $domain);
if ( $text == 'Scheduled for: <b>%1$s</b>') {
return $translations->translate( 'Event Date: <b>%1$s</b>' );
}
if ( $text == 'Published on: <b>%1$s</b>') {
@ichikaway
ichikaway / gist:2768801
Created May 22, 2012 12:37
RecursiveIteratorIterator example
<?php
Class TableRII extends RecursiveIteratorIterator {
private $parentKey = null;
public function beginIteration() {
echo '<table border=1><tr><th>key</th><th>value</th></tr>';
}
public function endIteration() {
echo '</table>';