Skip to content

Instantly share code, notes, and snippets.

View beatorizu's full-sized avatar
🤓
Focusing

beatorizu

🤓
Focusing
  • São José dos Campos, SP Brazil
  • 17:24 (UTC -03:00)
View GitHub Profile
@nunomazer
nunomazer / cv-completo.html
Last active April 10, 2024 23:25
exemplo de html com css utilizando dados de um curriculo vitae
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Curriculo Vitae</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
@jamiltron
jamiltron / basic_curry_ex.py
Created April 26, 2011 17:17
Very basic curry example in Python
# This is meant to show trivial examples of currying.
# I know there are way more effective methods of doing this
# but this is meant to be illustrative, I also want to add
# a few non-trivial examples to show how its useful.
import operator
def curry(func, var):
y = var
def f(x):
return func(x, y)
@billroy
billroy / jsonio.py
Created September 21, 2012 13:38
Read/write JSON object from file in python
import simplejson
import json
def put(data, filename):
try:
jsondata = simplejson.dumps(data, indent=4, skipkeys=True, sort_keys=True)
fd = open(filename, 'w')
fd.write(jsondata)
fd.close()
except:
@elena
elena / Basic MultiValueField MultiWidget
Created October 19, 2012 01:25
Super Basic Django MultiValueField / MutliWidget example
"""
An example of minimum requirements to make MultiValueField-MultiWidget for Django forms.
"""
import pickle
from django.http import HttpResponse
from django import forms
from django.template import Context, Template
from django.views.decorators.csrf import csrf_exempt
@davisford
davisford / gist:5039064
Last active February 9, 2022 13:39
git clone into non-empty directory

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:

@airtonix
airtonix / runserver.py
Created August 11, 2013 07:13
Management command that overrides the default runserver to provide `compass watch`
"""
License
=======
Do whatever you like.
Usage
=====
1. put it in your project
@rossdylan
rossdylan / curry.py
Created February 19, 2014 01:13
better implict function currying in python
from functools import partial
from inspect import getargspec
class Curryable(object):
"""
A decorator that implements implicit function currying in python
What this means is if you call a function with only part of its required
parameters, it will return a function that takes the remaining paramters
"""
def __init__(self, numArgs=-1):
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@subfuzion
subfuzion / global-gitignore.md
Last active July 16, 2024 18:54
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@bendc
bendc / alphabet.js
Created January 30, 2015 21:38
Array of uppercase and lowercase letters
const letters = (() => {
const caps = [...Array(26)].map((val, i) => String.fromCharCode(i + 65));
return caps.concat(caps.map(letter => letter.toLowerCase()));
})();