Skip to content

Instantly share code, notes, and snippets.

@Voonder
Voonder / .gitattributes
Last active December 24, 2024 17:19 — forked from pksunkara/config
Sample of git config file (Example .gitconfig, .gitattributes, .gitignore)
# Auto detect text files and perform LF normalization
* text=auto
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active March 9, 2025 22:47
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@chantastic
chantastic / on-jsx.markdown
Last active November 10, 2024 13:39
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@nephthys
nephthys / base.html
Last active February 27, 2018 13:05
Highlight current page / app in Django
<ul class="nav navbar-nav">
<li{% if app_name == 'pages' %} class="active"{% endif %}>
<a href="{% url "page_list" %}">{% trans "Pages" %}</a>
</li>
</ul>
@dpapathanasiou
dpapathanasiou / dst.py
Created August 16, 2014 15:42
How to tell if Daylight Savings Time is in effect using Python
from datetime import datetime
import pytz
def is_dst ():
"""Determine whether or not Daylight Savings Time (DST)
is currently in effect"""
x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern')) # Jan 1 of this year
y = datetime.now(pytz.timezone('US/Eastern'))
@duraz0rz
duraz0rz / With_ORM.cs
Last active August 9, 2021 00:53
C# example with and without ORM
/*
Very simple example using LINQ to SQL and based on the MSDN LINQ to SQL page.
Make sure you include System.Data.Linq and System.Data.Linq.Mappings in your usings.
*/
// Table you want to associate with the entity
[Table(Name="Customer")]
public class Customer
{
// Columns in the database. Should have the same name between database and class variable