Skip to content

Instantly share code, notes, and snippets.

View mc.php
<?php
$mc_apikey = 'xxx';
$request_url = 'https://us13.api.mailchimp.com/3.0/lists/ccea54209d/members/?offset=%s&count=%s';
$offset = 0;
$count = 200;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
View NavMenuWalker.php
<?php
namespace Dreamery\WP;
/* PHP */
use Exception;
/* WP Global */
use Walker;
use Dreamery\Template;
View bs4simplenav.html
<div class="container-fluid">
<nav class="navbar navbar-light bg-faded">
<a class="navbar-brand" href="#">Logo (this tag is optional)</a>
<ul class="nav navbar-nav">
<li class="nav-item"><a class="nav-link" href="#">Link 1</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link 2</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
Dropdown</a>
<ul class="dropdown-menu" aria-labelledby="Preview">
View gist:3c4a68dabba6e9f9c221f8927d3b8fdd
<div class="container-fluid">
<nav class="navbar navbar-light bg-faded">
<a class="navbar-brand" href="#">Logo (this tag is optional)</a>
<ul class="nav navbar-nav">
<li class="nav-item"><a class="nav-link" href="#">Link 1</a></li>
<li class="nav-item"><a class="nav-link" href="#">Link 2</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
Dropdown</a>
<ul class="dropdown-menu" aria-labelledby="Preview">
View gist:7550021
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
function ftp_uploadfiles($conn_id, $local_dir)
{
$handle = opendir($local_dir);
while (($file = readdir($handle)) !== false)
{
View gist:4958618
/* Author : Ross Williams (ross@guest.adelaide.edu.au.). */
/* Date : 3 June 1993. */
/* Version : 1.0. */
/* Status : Public domain. */
/* statically configured to produce any table covered by the Rocksoft^tm */
/* Model CRC Algorithm. For more information on the Rocksoft^tm Model CRC */
/* Algorithm, see the document titled "A Painless Guide to CRC Error */
/* Detection Algorithms" by Ross Williams (ross@guest.adelaide.edu.au.). This */
/* document is likely to be in "ftp.adelaide.edu.au/pub/rocksoft". */
View TileContentProvider.java
/*
* Needs a tile layer, something like (for Leaflet) ..
*
* var tl = L.tileLayer("content://com.pahasapatrails.m.tiles/{style}/{z}/{x}/{y}.png",
* { style: "XXX", minZoom: 9, maxZoom: 13, tms: true });
* map.addLayer(tl);
*
*
* Also needs a provider entry under the application tag in the Android
* Manifest, something like the following ..
@thesjg
thesjg / SOC11DEVAPI1.txt
Created Jun 3, 2011
Basic kevent device API
View SOC11DEVAPI1.txt
/*
* Used to maintain information about processes that wish to be
* notified when I/O becomes possible.
*/
struct kev_filter {
struct kev_filter_entry_list kf_entry;
struct kev_filter_ops kf_ops;
caddr_t fo_hook;
};
View SOC11API1.txt
KEVENT SUBSYSTEM REFACTOR DESIGN DOCUMENT
/*
* Drivers and etc. will only expose an event filter now, instead of
* attach/detach/event filters. One filter function each is exposed for read,
* write, except, etc (instead of 3 each).
*
* A new kq api will be exposed for drivers to hook themselves into kq at
* initialization time, they will provide flags (such as whether they are mpsafe
* or not), some opaque private data (a hook) and a function pointer. The driver
View Hammer_0byte_optimization.txt
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] i think we should commit an optimization for that phoronix threaded i/o tester
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] that just ignores about 80% of the i/o's
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:10] :-)
<dillon!~dillon@leaf.dragonflybsd.org> [03:11] we could certainly optimize buffers containing all-zeros (if we don't already). heh
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] that might be useful
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] they are probably all zero's
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] i looked at what it did
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:11] it just allocated a chunk ala malloc() and then wrote that allocated buffers contents to a file
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:12] it never touched the buffer
<thesjg!~sjgirc@67-54-133-153.cust.wildblue.net> [03:13] how do you know if its all zero's, in an efficient fashion