Skip to content

Instantly share code, notes, and snippets.

View r14c's full-sized avatar

Romina K S r14c

View GitHub Profile
// Facebook Profile Getter
// From Friend List
JSON.stringify(Array.prototype.slice.call($$('._698 img')).map(function (el) {
var parts = el.src.match(/(.*?\.net\/.*?)\/.*?\/([0-9]+_[0-9]+_[0-9]+_s\.jpg)/i);
return parts && [parts[1], parts[2].replace('s', 'n')].join('/');
}));
// From Photos
JSON.stringify(Array.prototype.slice.call($$('._6i9 .tagWrapper i')).map(function (el) {
var url = el.style.background.match(/url\((.*?)\)/),
parts = url[1] && url[1].match(/(.*?\.net\/.*?)\/.*?\/([0-9]+_[0-9]+_[0-9]+_n\.jpg)/i);
-record(myopaque, {udata,
times = 0,
foobar}).
out(A) ->
H = A#arg.headers,
C = H#headers.cookie,
case yaws_api:find_cookie_val("baz", C) of
[] ->
M = #myopaque{},
@r14c
r14c / decorators.py
Created May 30, 2014 21:16
LoginRequiredMiddleware
try:
from functools import update_wrapper
except ImportError:
from django.utils.functional import update_wrapper # Python 2.3, 2.4 fallback.
from django.contrib.auth.decorators import _CheckLogin
def login_not_required(view_func):
"""
Decorator which marks the given view as public (no login required).
@r14c
r14c / index.md
Last active August 29, 2015 14:04
Design Wisdom

Design Wisdom

There are a lot of really great snippets of wisdom available on the internet for building and designing beautiful and friendly software. My goal is to collect as much of it as possible right here.

@r14c
r14c / rcombinations.py
Last active August 29, 2015 14:07
Restricted Combinations
# -*- coding: utf-8 -*-
"""
rcombinations.py
~~~~~~~~~~~~~~~~
Implements different a restricted combination function.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
@r14c
r14c / tail_recursive.py
Created December 2, 2014 22:14
Tail Recursion Decorator
# -*- coding: utf-8 -*-
class tail_recursive(object):
"""
Based on comments on this active state recipe: <http://code.activestate.com/recipes/496691/>
"""
def __init__(self, func):
self.func = func
self.firstcall = True
self.CONTINUE = object()
@r14c
r14c / gogs.xml
Last active August 29, 2015 14:12
Gogs SMF Manifest
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest"
name="export">
<service name="application/gogs"
type="service"
version="1">
<create_default_instance enabled="false" />
<single_instance />
<dependency name="network"
@r14c
r14c / coinflip.py
Last active July 6, 2016 01:18
Coinflip!
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Takes an arbitrary number of command line arguments and randomly selects one
to return. The amount of entropy involved can be adjusted by setting the
environment variable ```RANDBYTES```, which defaults to 4096.
"""
from __future__ import print_function
@r14c
r14c / backends.py
Last active August 29, 2015 14:14
Case-insensitive ModelBackend for Django
# -*- coding: utf-8 -*-
"""
Case-Insensitive ModelBackend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
@r14c
r14c / index.md
Last active August 29, 2015 14:15
Frontend Development Resources

A few basic resources to get started with. Until you know better, Douglas Crockford is your God. Listen to His words and preach His Gospel. Slay Him when He begins to stand in your way.

JS Application Frameworks

  • [React][1]
  • [AngularJS][2]
  • [Ember][3]
  • [Backbone][4]