Skip to content

Instantly share code, notes, and snippets.

View techmagus's full-sized avatar
💭
🇵🇭

Yohan Yuki Xieㆍ사요한・謝雪矢 techmagus

💭
🇵🇭
View GitHub Profile
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@jdevalk
jdevalk / gist:5623050
Created May 21, 2013 20:39
Redirect script sample NGINX code. Make sure this location line sits above the "location /" code in your NGINX config.
location /redirect/ {
rewrite ^/redirect/(.*)$ /redirect/index.php?id=$1 last;
}
@andrewlkho
andrewlkho / gist:7373190
Last active March 25, 2024 03:37
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@d1manson
d1manson / BlobWorker.js
Last active June 27, 2018 11:28
Using an HTML5 Blob, you can get around the same-origin security restriction for Web Workers. The only slight complication is the need to return a Worker-like interface synchrounously. But this is actually fairly simple. Requires jQuery $ for ajax call. IE doesn't permit making workers from blob-urls, but other browsers do.
Worker = (function(){
var nativeWorker = Worker;
var BlobWorker = function(){
this.queuedCallList = [];
this.trueWorker = null;
this.onmessage = null;
}
BlobWorker.prototype.postMessage = function(){
if(this.trueWorker)
@revelt
revelt / Hugo — Replace dashes on taxonomy terms
Created June 19, 2016 06:04
When your Hugo taxonomy term consists of multiple words, it will be shown with dashes. Here's how to restore spaces.
<a href="/categories/{{ $name | urlize }}">{{ replace $name "-" " " }}</a>
@techmagus
techmagus / keybase.md
Last active June 3, 2017 07:54
Keybase verification

Keybase proof

I hereby claim:

  • I am techmagus on github.
  • I am yukino (https://keybase.io/yukino) on keybase.
  • I have a public key whose fingerprint is CDB7 5E8E 8397 0FE2 8887 A05A DF3B 8EBF D250 A680

To claim this, I am signing this object:

@Pulimet
Pulimet / AdbCommands
Last active April 19, 2024 11:58
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
#!/usr/bin/php
<?php
declare(strict_types = 1);
// require_once ('hhb_.inc.php');
hhb_init ();
if ($argc !== 3) {
fprintf ( STDERR, "usage: %s timestamp url\n", $argv [0] );
fprintf ( STDERR, "example: %s 20091012061648 http://www.p4w.se\n", $argv [0] );
die ( 1 );
}