Skip to content

Instantly share code, notes, and snippets.

View neruthes's full-sized avatar
🏳️
Vive la France

Neruthes 0x5200DF38 neruthes

🏳️
Vive la France
View GitHub Profile
var result = ~ function(str) {
// Define a DSL
var r = function(target, replace) {
str = str.replace(new RegExp(target, 'gi'), replace || target);
};
// Use the DSL
r('JavaScript');
r('gogle', 'Google');
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3B%24('link%5Brel%3Dstylesheet%5D').add('style').remove()%3B%24('%5Bstyle%5D').attr('style'%2C%20'')%3B%24('head').append('%3Clink%20rel%3D%22stylesheet%22%20href%3D%22http%3A%2F%2Fneop.me%2Fmedia%2Fzen-css%2Fzen.css%22%20type%3D%22text%2Fcss%22%20%2F%3E')%3B%24('body').addClass('zenmode').css(%7Bwidth%3A%20'800px'%2C%20margin%3A%20'0%20auto'%2C%20'word-wrap'%3A%20'break-word'%7D)%3B%24('a%20img').css(%7B'max-height'%3A%20'700px'%2C%20'max-width'%3A%20'700px'%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22http%3A%2F%2Fneop.me%2Fmedia%2Fjq.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@weisi
weisi / dns_ttl.sh
Last active July 25, 2020 06:42
尝试利用 IP.TTL 确定 DNS 污染发生的位置
#!/bin/bash
# Weisi Dai <weisi@cmu.edu>
#
# Usage: bash dns_ttl.sh 8.8.8.8
#
# Dependencies: mtr dig iptables bc
DOMAIN=twitter.com
DNS=$1
@jysperm
jysperm / QQ-Qun.md
Last active January 7, 2016 02:58
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@smajda
smajda / aggregate-feed.php
Created October 7, 2009 16:41
Merge multiple RSS feeds with SimplePie
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/