Skip to content

Instantly share code, notes, and snippets.

@mageekguy
mageekguy / gist:29cdf2e52d1c507f25b3
Last active October 24, 2015 22:33
Mysqli and generator are in a boat...
<?php
namespace db;
class client
{
private
$user,
$password,
$host,
@meglio
meglio / Lazy.php
Last active November 24, 2015 02:02
<?php
/**
* Trait Lazy
*
* Allows for static and dynamic lazy initialization.
* NB. Include "use Lazy;" in every class you want this functionality, otherwise collision may happen if any of parents use Lazy.
*
* Example:
@edtoon
edtoon / gist:6358598
Last active December 21, 2015 20:00
example mod_vhost_dbd / wildcard hosting server
#########################
# install binary stuffs #
#########################
apt-get install apache2 apache2-prefork-dev libaprutil1-dbd-mysql unzip mysql-server
mkdir -p /usr/local/src/mod_vhost_dbd
cd /usr/local/src/mod_vhost_dbd
wget http://dbd-modules.googlecode.com/files/dbd-modules-1.0.6.zip
unzip dbd-modules-1.0.6.zip
apxs2 -c mod_vhost_dbd.c
section36:[~/aatemp]$ xattr -px com.apple.metadata:kMDItemWhereFroms ~/Desktop/Porkins.jpg | xxd -p -r | plutil -convert xml1 -o - -
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>http://images3.wikia.nocookie.net/__cb20111104223727/starwars/images/5/53/Porkins.jpg</string>
<string></string>
</array>
</plist>
@marekjelen
marekjelen / gist:3731919
Created September 16, 2012 10:40
OpenShift @ Ubuntu
# Resources:
#
# * http://bencord0.wordpress.com/2012/08/11/openshift/
#
# Starting with clean install of Ubuntu for start
# Update the system
apt-get update
apt-get upgrade
@inureyes
inureyes / ddns.py
Created May 10, 2016 03:23 — forked from allieus/ddns.py
Route 53 에 내 도메인 정보 반영하기 (Dynamic DNS 로 활용하기)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from boto.route53 import connect_to_region
from boto.route53.record import ResourceRecordSets
def apply(domain, ip, ttl, region, access_key=None, secret_key=None):
if access_key:
os.environ.setdefault('AWS_ACCESS_KEY_ID', access_key)
@soomtong
soomtong / swap-key-guide.sh
Last active September 22, 2017 12:15
Swap modify keys in Linux Ubuntu
// https://www.x.org/archive/X11R6.8.1/doc/xmodmap.1.html
// https://www.linux.com/learn/how-kill-caps-lock-your-linux-desktop
// http://egloos.zum.com/nemonein/v/5222946
$ tail .zshrc
if [[ "$(uname -s)" == "Linux" ]]; then
if [ -x ~/Dropbox/config/tweak/swap_key.sh ]; then
xmodmap ~/Dropbox/config/tweak/swap_key.sh
fi
fi
@hanbyul-here
hanbyul-here / seoul-metro-line-1.geojson
Created November 24, 2016 02:51
서울 지하철 위치정보 데이터
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Simple spreadsheet, with first sheet containing form submission repsonses
// when the form is submitted:
// 1) grab the latest response,
// 2) post it to a third party service via an HTTP POST
function testWebhook() {
var ss = SpreadsheetApp.openById(SPREADSHEET_ID);
var form=ss.getSheets()[0];
var lr=form.getLastRow();
var el=form.getRange(lr,2,1,1).getValue();
var t=el;
@yassermog
yassermog / MY_Input.php
Last active August 1, 2018 10:00 — forked from nambok/MY_Input.php
Extends codeigniter input class to accept put and delete requests ........ Just Put this file in application/core/MY_Input.php ........ NOW you can $data=$this->input->put('key');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Input extends CI_Input {
/**
* Variables
*
*/
protected $delete;