Skip to content

Instantly share code, notes, and snippets.

View lastguest's full-sized avatar
❄️
I may be slow to respond.

Stefano Azzolini lastguest

❄️
I may be slow to respond.
View GitHub Profile
@lastguest
lastguest / explode.c
Created March 25, 2013 15:37 — forked from kopiro/explode.c
char** explode(char delimiter, char* str) {
int l = strlen(str), i=0, j=0, k=0;
char x = NULL;
char** r = (char**)realloc(r, sizeof(char**));
r[0] = (char*)malloc(l*sizeof(char));
while (i<l+1) {
x = str[i++];
if (x==delimiter || x=='\0') {
r[j][k] = '\0';
r[j] = (char*)realloc(r[j], k*sizeof(char));

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
@lastguest
lastguest / Excel.php
Last active September 6, 2017 09:39 — forked from ihumanable/Excel.php
[Simple Excel writer class] #PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
#!/usr/bin/env php
<?php
/* original version can be found at https://gist.github.com/181172 */
if( ! function_exists( 'inotify_init' ) ) {
die_with_error( 'This script needs the inotify module' );
}
$excludePatterns = array(
<!DOCTYPE HTML>
<html>
<head>
<title>iFrame</title>
</head>
<body>
<!-- Page Content -->
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
<?php
class OpenStruct extends ArrayObject
{
public function __construct($input = array())
{
parent::__construct($input, static::ARRAY_AS_PROPS);
}
public function offsetSet($key, $value)
{
# Install XCode.
# Install XCode CLI Tools.
# Select XCode.
xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Install Auto Tools.
brew install autoconf automake
# Symlink iOS Simulator.
#!/bin/sh
#current info
CUR_URL=development.server.com
CUR_DB_HOST=database_host
CUR_DB_NAME=database_name
CUR_DB_USER=database_user
CUR_DB_PASS=database_password
CUR_PATH=/path/to/site/
/ HTML5 Doctype. Remember to delete these comments (Quirks Mode).
!!!
/ Modernizr HTML tag.
%html.no-js{lang: ""}
/ Let's get started.
%head
/ Document settings and metadata.