Skip to content

Instantly share code, notes, and snippets.

View mkeneqa's full-sized avatar
♣️
Chaos EnCode

Mike mkeneqa

♣️
Chaos EnCode
View GitHub Profile
@smasty
smasty / 01.php
Created June 6, 2011 22:33
10 PHP One Liners to Impress Your Friends - http://smasty.net/blog/10-php-oneliners
<? foreach(range(1, 10) as $i) echo $i * 2 . " ";
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@skarllot
skarllot / backup_mysqldb.sh
Last active November 30, 2022 08:50
Bash script to backup all mysql databases thru mysqldump
#!/bin/bash
# Destiny folder where backups are stored
DEST=/tmp/bacula/server01
CURRDATE=$(date +"%F")
# Hostname where MySQL is running
HOSTNAME="srv-mysql"
# User name to make backup
USER="root"
@ykessler
ykessler / gae_handler.py
Created May 11, 2012 20:23
Python logging handlers
class GAEHandler(logging.Handler):
"""
Logging handler for GAE DataStore
"""
def emit(self, record):
from google.appengine.ext import db
class Log(db.Model):
name = db.StringProperty()
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@printminion
printminion / parseGData.php
Last active November 16, 2020 08:14
Parse Google Drive spreadsheet data via php
<?php
/**
* @desc Parse Google Drive spreadsheet data via php
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/
* @link https://gist.github.com/3898429
*/
//Spreadsheet https://docs.google.com/spreadsheet/pub?key=0Akgh73WhU1qHdFg4UmRhaThfUFNBaFR3N3BMVW9uZmc&output=html
//JSON Representation
@betweenbrain
betweenbrain / gist:5405671
Created April 17, 2013 16:26
Use cURL and SimpleXML to retrieve and parse Wordpress RSS feed
<?php
$curl = curl_init();
curl_setopt_array($curl, Array(
CURLOPT_URL => 'http://blogs.guggenheim.org/map/feed/',
CURLOPT_USERAGENT => 'spider',
CURLOPT_TIMEOUT => 120,
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_RETURNTRANSFER => TRUE,
@vasiliishvakin
vasiliishvakin / mysql_db_sync
Last active July 10, 2024 08:10
Simple bash script to sync remote mysql db to local
#!/bin/bash
LOCAL_DB=""
REMOTE_DB=""
LOCAL_USER="root"
LOCAL_PASS=""
REMOTE_USER="root"
REMOTE_PASS=''
@dbehnke
dbehnke / client.py
Created March 18, 2014 19:08
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD