Skip to content

Instantly share code, notes, and snippets.

View codeshard's full-sized avatar
🎯
Focusing

Ozkar L. Garcell codeshard

🎯
Focusing
View GitHub Profile
@Geweldig
Geweldig / download.sh
Last active December 12, 2021 16:05
Download the latest AppImage for Onivim 2
#!/bin/bash
LICENSE_KEY="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
API_KEY="AIzaSyDxflsfyd2gloxgWJ-GFtPM46tz-TtOXh8"
is_valid_key=$(curl -s "https://v2.onivim.io/api/isLicenseKeyValid?licenseKey=${LICENSE_KEY}")
if [[ "$is_valid_key" != 'true' ]]; then
echo "Invalid key provided: ${LICENSE_KEY}"
exit 1
fi
@DmytroLitvinov
DmytroLitvinov / messages.html
Last active September 13, 2021 22:18
[Django middleware for AJAX messages] Middleware for JSON responses. It adds to each JSON response array with messages from django.contrib.messages framework. It allows handle messages on a page with javascript. Django 1.10. #tags: django, python, ajax
<div id="messages">
{% for message in messages %}
<div {% if message.tags %}class="alert alert-dismissable alert-{{ message.tags }}"{% endif %}>
<a class="close" data-dismiss="alert" href="#">&times;</a>
{{ message }}
</div>
{% endfor %}
</div>
@ScottSmith95
ScottSmith95 / Share-Sheet.html
Last active October 22, 2021 13:40
A responsive web version of iOS Share Sheets. More info: https://ScottHSmith.com/projects/share-sheets/
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
font: normal 300 1em sans-serif;
}
@ibarovic
ibarovic / forms.py
Created July 11, 2012 20:00
django crispy forms and django inline forms example (inlineformset_factory)
class AuthorForm(ModelForm):
def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
Field('name'),
)
super(AuthorForm, self).__init__(*args, **kwargs)
class Meta:
model = Author
@maraujop
maraujop / forms.py
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()