Skip to content

Instantly share code, notes, and snippets.

View neara's full-sized avatar
🏠
Working from home

Ana neara

🏠
Working from home
View GitHub Profile
@neara
neara / basic_router.jsx
Created January 18, 2018 12:57 — forked from siakaramalegos/basic_router.jsx
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
import asyncio
import time
def timeit(func):
async def process(func, *args, **params):
if asyncio.iscoroutinefunction(func):
print('this function is a coroutine: {}'.format(func.__name__))
return await func(*args, **params)
else:
@neara
neara / modular_settings.py
Created May 18, 2016 15:18
How init inside settings should look like for modular approach
from base import *
env = os.environ.get('ENV')
if env == 'local':
from local import *
elif env == 'prod':
from production import *
else:
from local import *
@neara
neara / README.md
Created January 4, 2016 09:52 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@neara
neara / supervisor.conf
Created October 15, 2015 09:09 — forked from tsabat/supervisor.conf
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@neara
neara / cx_oracle_instructions.md
Last active December 3, 2015 14:17 — forked from thom-nic/cx_oracle_instructions.md
Installing CX Oracle for Python & Mac OS X. Instructions exist around the web, but they seem to be piecemeal and incomplete.
@neara
neara / git_tags_cleanup_example.sh
Created August 12, 2015 13:41
A short example of how to clean tags on remote and local repo.
#!/bin/bash
echo "Firing up git tag cleanup..."
echo "Getting all tags.."
counter=1
for t in `git tag`
do
if [ "$t" = "babette" ] || [ "$t" = "blah-HF-2" ]; then
echo "$t is a keeper"
@neara
neara / python_utils
Last active September 28, 2016 13:53
import time
import string
import random
import hashlib
import logging
import urlparse
from _ssl import SSLError
from itertools import izip_longest
import facebook
@neara
neara / jquery.resizeimage.coffee
Created February 22, 2015 09:43
jQuery resize image plugin
$ = jQuery
# FIXME add support for resize without preview
$.fn.extend
# plugin name
resizeImage: (options) ->
# default settings
settings =
@neara
neara / utils-requirejs
Last active August 29, 2015 14:14
UTILS as RequireJS module
/**
* UTILS module - contains a number of general methods.
* Inspired by http://javascript.crockford.com/remedial.html
* Created by anatr on 1/14/15.
*/
(function (define) {
"use strict";
if (!String.prototype.supplant) {
/**