Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@danott
danott / entities.css
Created January 31, 2011 22:07
Use CSS's :after pseudo-selector to insert hexadecimal values of html entities into the document. Less markup. More awesome.
/* Daniel Ott
* entities.css
* 31 January 2011
*
* Adding arrows to thinks makes them more clickable. Right?
* Use CSS's :after pseudo-selector to insert hexadecimal values
* of html entities into the document. Less markup. More awesome.
*/
.add-an-arrow:after {
anonymous
anonymous / gist:5237879
Created March 25, 2013 15:20
<?php
/*********************************/
$fbAppId = "150734978329989"; // replace this with your Facebook Apps' App ID
$fbAppSecret = "b62cb0fa9d74e2c8ce74198343938241";
/*********************************/
//Login for serving the Ajax routine
if ( $_GET['ajax']=="yes" ) {
@JWally
JWally / RelationshipTree.js
Last active September 8, 2022 12:13
Javascript Algorithm to build an org chart from an array of related objects
var ary = [
{id: "a", parent: 0},
{id: "b", parent: "a"},
{id: "c", parent: "b"},
{id: "d", parent: "c"},
{id: "e", parent: "d"},
{id: "f", parent: "e"},
{id: "g", parent: "f"},
{id: "h", parent: "g"},
{id: "i", parent: "h"},
@OutThisLife
OutThisLife / gravity-form.php
Last active October 27, 2020 04:38
Custom: Gravity Forms ajax submissions
<?php
/**
* Simple file to help add manual entries to a gravity form, so we don't have to deal w/ GFs output.
*/
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp/wp-load.php';
$data = $_REQUEST;
// -----------------------------------------------
@mesonoxian
mesonoxian / zookeeper-kafka
Created May 27, 2015 07:01
Simple Zookeeper and Kafka init.d Startup Script
#! /bin/bash
### BEGIN INIT INFO
# Provides: kafka
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: kafka service
### END INIT INFO

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@yunusga
yunusga / gist:33cf0ba9e311e12df4046722e93d4123
Created April 5, 2017 11:55
Debug WordPress 404 issues (permalinks, rewrite rules, etc.)
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {
@hubgit
hubgit / SelectField.tsx
Last active December 29, 2023 03:41
Use react-select with Formik
import { FieldProps } from 'formik'
import React from 'react'
import Select, { Option, ReactSelectProps } from 'react-select'
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({
options,
field,
form,
}) => (
<Select
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active March 7, 2024 13:38
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}