Skip to content

Instantly share code, notes, and snippets.

View gtgt's full-sized avatar
🏠
Working from home

GT gtgt

🏠
Working from home
View GitHub Profile
@ypresto
ypresto / prepare-gentoo-prefix-macosx.sh
Created March 21, 2012 07:40
Gentoo prefix installation on Mac OS X
#!/usr/bin/bash
# Gentoo prefix installation on Mac OS X (Mar. 2012)
# This script may be outdated soon.
# Please refer: http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml
export EPREFIX="$HOME/gentoo"
export PATH="$EPREFIX/usr/bin:$EPREFIX/bin:$EPREFIX/tmp/usr/bin:$EPREFIX/tmp/bin:$PATH"
curl -o bootstrap-prefix.sh 'http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt'
<?php
/**
* Eurotax Valuation Webservice Handler
*
* This class allows connecting to Eurotax Webservice, fetching dictionary data
* and request vehicle valuation.
*
* Usage example:
* <code>
* <?php
@yoneken
yoneken / ddclient-mydns-patch.txt
Created July 26, 2012 03:00
This is a patch to add mydns support for ddclient. The original patch is written by ta-ta. Thanks!
--- ddclient.orig 2012-07-16 23:32:28.000000000 +0900
+++ /usr/sbin/ddclient 2012-07-20 00:07:06.000000000 +0900
@@ -429,6 +429,11 @@
'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef),
'client' => setv(T_STRING, 0, 1, 1, $program, undef),
},
+ 'mydns-common-defaults' => {
+ 'min-interval' => setv(T_DELAY, 0, 0, 1, interval('30s'), 0),
+ 'max-interval' => setv(T_DELAY, 0, 0, 1, interval('3d'), 0),
+ 'server' => setv(T_FQDNP, 1, 0, 1, 'www.mydns.jp', undef),
@nebirhos
nebirhos / jquery.ajax.progress.js
Created October 15, 2012 11:26 — forked from db/jquery.ajax.progress.js
add XHR2 upload and download progress events to jQuery.ajax
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function" && that.progress !== undefined) {
req.addEventListener("progress", function(evt) {
that.progress(evt);
}, false);
@K-Phoen
K-Phoen / config.yml
Created December 18, 2012 11:22
Storing Symfony2 sessions in memcached
imports:
# ....
- { resource: services/session.yml }
framework:
# ....
session:
handler_id: session.handler.memcached
@zhaostu
zhaostu / !.md
Last active August 25, 2020 08:40
Configure Synaptics/ALPS/ElanTech touchpad for Chromium OS.
@krakjoe
krakjoe / pthreads.md
Last active August 30, 2023 18:30
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@Stanback
Stanback / nginx.conf
Last active July 24, 2024 18:44 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@granoeste
granoeste / webkitmediasource-is-type-supported.html
Last active December 26, 2021 10:54
[JavaScript][HTML5][MediaSource] MediaSource.isTypeSupported
<!DOCTYPE html>
<html>
<head>
<script>
window.MediaSource = window.MediaSource || window.WebKitMediaSource;
function testTypes(types) {
for (var i = 0; i < types.length; ++i)
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i]));
}
@marlun78
marlun78 / $once.js
Last active February 28, 2018 19:19
Angular $rootScope.Scope.$once
/**
* Angular $rootScope.Scope.$once
* Copyright (c) 2014 marlun78
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83
*/
$provide.decorator('$rootScope', function ($delegate) {
var Scope = $delegate.__proto__.constructor;
Scope.prototype.$once = function (name, listener) {
var deregister = this.$on(name, function () {
deregister();