Skip to content

Instantly share code, notes, and snippets.

View y4rr's full-sized avatar
💭
Learning stuff

y4rr

💭
Learning stuff
View GitHub Profile
@Griever
Griever / UserScriptLoader.uc.js
Created April 7, 2010 12:35
Greasemonkey っぽいもの
// ==UserScript==
// @name UserScriptLoader.uc.js
// @author Griever
// @include main
// @description Greasemonkey っぽいもの
// @version 0.1.6.1
// @note 0.1.6.1 uAutoPagerize との連携ができなかったのを修正
// @note 0.1.6.1 .user.js 間での連携は多分できません。。
// @note 0.1.6 色々修正。unsafeWindow 使ってて動かなかった物が動くかも
// @note 0.1.6 Firefox 3.6 は切り捨てた
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@itod
itod / extract_iphoto_originals.applescript
Last active April 8, 2022 14:55
Recursively extract Original photos from an iPhoto library
set _srcPath to ((get path to desktop) & "Backup:Pictures" as string)
set _destPath to ((get path to desktop) & "Out" as string)
on processDir(_parent)
tell application "Finder"
set _parentName to (get name of _parent as string)
set _kids to (get every item of _parent whose name is not ".")
if "Thumbs" is equal to _parentName then
return
else if "Originals" is equal to _parentName then
@BlackPrincess
BlackPrincess / javascriptのカンマ構文.md
Created July 24, 2013 15:44
javascriptにもカンマ構文があったらしい・・・

抜き打ちテストが分からなかった

じゃあ this の抜き打ちテストやるぞーをやってみた。
結果として、コードが読めなくて2問空欄解答をするしかなかったので調べてみました。

あ、やってない人は読む前に先にやってみてください。
ちなみにthisの話はあんまりしません。
そして今日調べたばかりなので間違っている可能性や、そもそも自分の知識不足のせいでバカ発見されただけかも知れません。

ただのindirect eval

@cjrd
cjrd / README.md
Last active September 28, 2023 18:17
Interactive tool for creating directed graphs using d3.js.

directed-graph-creator

Interactive tool for creating directed graphs, created using d3.js.

Demo: http://bl.ocks.org/cjrd/6863459

Operation:

  • drag/scroll to translate/zoom the graph
@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@gruber
gruber / make_bookmarklet.pl
Last active May 5, 2024 21:11
JavaScript Bookmarklet Builder
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR
@ebidel
ebidel / highlight_custom_elements.js
Last active June 13, 2022 21:35
Bookmarklet for highlight custom elements on a page
// Highlights all custom elements on the page.
// 7/31/2016: updated to work with both shadow dom v0 and v1.
// To create a bookmarklet, use http://ted.mielczarek.org/code/mozilla/bookmarklet.html
var allCustomElements = [];
function isCustomElement(el) {
const isAttr = el.getAttribute('is');
// Check for <super-button> and <button is="super-button">.
return el.localName.includes('-') || isAttr && isAttr.includes('-');

radare2 is a very cool set of tools that you probably don't know how to use! Let's go through a simple exploit CTF challenge to understand how to use it for exploit development.

We'll be focusing on "ropasaurus rex" which is a simple challenge from Plaid CTF After checking out the latest and greatest radare from git, let's get started!

Open up ropasaurusrex in r2 and call analyze on the binary. We can list the functions with "afl"

@pongstr
pongstr / shorthand-javascript-techniques.md
Last active June 22, 2022 20:09
Shorthand Coding Techniques. Original post by @samdeering http://www.sitepoint.com/shorthand-javascript-techniques/

Javascript Shorthand Coding Techniques

My (@pongstr) opinion about shorthand coding techniques

Shorthand code is not really a replacement for normal coding but it is very handy and useful in some cases. There are tons of opinions and debates around this but, again it all comes down what is necessary for your codebase and using it responsibly.