Skip to content

Instantly share code, notes, and snippets.

View jacmoe's full-sized avatar

Jacob Moena jacmoe

View GitHub Profile
@nfreear
nfreear / swiki.php
Created April 30, 2011 13:52
Display Bitbucket wiki pages with SimpleWiki parser.
<?php
/**Display Bitbucket wiki pages with SimpleWiki parser.
* A rough script for refactoring.
*
* @copyright Copyright Nick Freear, 29 April 2011.
* @uses http://simplewiki.org/language#patterns
*/
ini_set('display_errors', 1);
header('Content-Type: text/html; charset=utf-8');
@benui-dev
benui-dev / perceptron.py
Created June 6, 2011 02:36
Playing with making a simple perceptron in Python. Used Foundations of Statistical Natural Language Processing as a reference.
# Ben's Magical Perceptron
def dot_product(a, b):
return sum([a[i]*b[i] for i in range(len(a))])
def decision( x, w, theta ):
return (dot_product(x, w) > theta)
@paulirish
paulirish / gist:1445367
Created December 7, 2011 23:55
barackobama.com's css
@charset "utf-8";
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video
{ margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section
{ display: block }
blockquote, q { quotes: none }
@mrkmg
mrkmg / JApi.php
Created May 11, 2012 14:08
JApi, short for JSON API, is an action handler for Yii.
<?php
/**
* JApi, short of JSON API, is an action handler for Yii.
*
* JApi maps requests in the form ?r=controller/japu&action=method to controller->japiMethod. Then, anything returned from
* japiMethod is encoded in JSON and sent to the client. Parameters in the function are mapped to _GET varibles. JApi
* follows the requirments of the parameters, such as optional and required.
*
* EXAMPLE:
in ExampleController.php
@ralphcrisostomo
ralphcrisostomo / xampp_proxy_server_config
Created November 8, 2012 02:37
XAMPP Proxy Server Config
1. Open /Applications/XAMPP/etc/httpd.conf
2. Enable the following Modules by removing the # at the front of the line.
- LoadModule rewrite_module modules/mod_rewrite.so
- LoadModule proxy_module modules/mod_proxy.so
- LoadModule proxy_http_module modules/mod_proxy_http.so
3. Copy and Paste below to the bottom of httpd.conf
# Implements a proxy/gateway for Apache.
@gka
gka / _readme.md
Created January 24, 2013 20:43
PHP Endpoint for Github Webhook URLs

PHP Endpoint for Github Webhook URLs

If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.

  1. Put github.php somewhere on your PHP-enabled web server, and make it accessible for the outside world. Let's say for now the script lives on http://example.com/github.php
@mikeando
mikeando / Demo.c
Last active March 20, 2024 10:47
Example of using C++ from C.
#include "HMyClass.h"
#include <stdio.h>
void my_eh( const char * error_message, void * unused)
{
printf("my_eh: %s\n", error_message);
}
int main()
{
@joar
joar / donate-bitcoin.html
Last active September 27, 2023 07:48
Quick and dirty bitcoin donation button, as seen on https://gobblin.se
<style>
.donate-button {
text-align: center;
}
.donate-button .bitcoin-address {
font-size: 1.5em;
}
</style>
<div class="donate-button">
@aras-p
aras-p / preprocessor_fun.h
Last active May 28, 2024 05:15
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@markusfisch
markusfisch / README.md
Last active July 15, 2021 14:58
bash script to build a texture atlas with a little help from ImageMagick

mkatlas

[BASH][1] script to build a [texture atlas][2] for small/medium web sites/games. Requires [ImageMagick][3].

Usage

Basic