Skip to content

Instantly share code, notes, and snippets.

View Maharramoff's full-sized avatar
🇦🇿

Maharramoff

🇦🇿
View GitHub Profile
@igal
igal / gist:53855
Created January 28, 2009 07:29
.gitrc aliases for common git commands
# Aliases for common git commands. E.g., enter "git d" for "git diff"
# These settings live in the ~/.gitconfig file.
[alias]
b = branch
ba = branch -a
ci = commit
co = checkout
d = diff
dc = diff --cached
@tonyhb
tonyhb / BCP47 PHP Language Code Array
Created October 19, 2010 23:28
BCP47 (HTML 5 Language Attribute) Language Codes as a PHP Array, taken from http://www.iana.org/assignments/language-subtag-registry
<?php
/**
* These are just the language codes, not regions. This means it only lists en, not en-US, en-CA etc.
* @see http://www.iana.org/assignments/language-subtag-registry
*/
return array
(
"aa" => "Afar",
"ab" => "Abkhazian",
@ma11hew28
ma11hew28 / string-additions.rb
Created April 2, 2011 14:17
String#reverse_words & #longest_run
require 'rspec'
class String
if method_defined? :reverse_words
raise "String#reverse_words is already defined"
end
def reverse_words
split(' ').reverse!.join(' ')
end
@dpifke
dpifke / counter_test.py
Created March 29, 2012 23:32
Performance comparison of defaultdict vs. Counter and tuple vs. namedtuple in Python
#!/usr/bin/python
#
# Copyright (c) 2012 Dave Pifke.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@kim3er
kim3er / jquery.sum.js
Created September 4, 2012 09:36
Sum, Max & Min functions in jQuery
(function ($) {
// DOM
if (!Array.prototype.sum)
Array.prototype.sum = function () {
for (var i = 0, l = this.length, sum = 0; i < l; sum += this[i++]);
return sum;
};
if (!Array.prototype.max)
Array.prototype.max = function () {
@larsks
larsks / blogger2scriptogram.py
Created November 6, 2012 04:23
Convert Blogger posts to Markdown for use with Scriptogr.am
#!/usr/bin/python
import os
import sys
import argparse
import iso8601
import re
import subprocess
import logging
import json
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@addyosmani
addyosmani / limitLoop.js
Last active April 25, 2024 19:10
Limit the frame-rate being targeted with requestAnimationFrame
/*
limitLoop.js - limit the frame-rate when using requestAnimation frame
Released under an MIT license.
When to use it?
----------------
A consistent frame-rate can be better than a janky experience only
occasionally hitting 60fps. Use this trick to target a specific frame-
rate (e.g 30fps, 48fps) until browsers better tackle this problem
@rxaviers
rxaviers / gist:7360908
Last active July 29, 2024 04:00
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jphase
jphase / regexYoutube.html
Last active November 26, 2021 21:29
Regex match all youtube links
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
<div id="anothercontainer">