Skip to content

Instantly share code, notes, and snippets.

View bartmika's full-sized avatar

Bartlomiej Mika bartmika

View GitHub Profile
@wholypantalones
wholypantalones / stateprov.json
Created April 1, 2014 15:17
US States And Canadian Provinces In JSON format
[{
"name": "Alabama",
"abbreviation": "AL"
}, {
"name": "Alaska",
"abbreviation": "AK"
}, {
"name": "American Samoa",
"abbreviation": "AS"
}, {
@koistya
koistya / React-Directory-Layout.md
Last active June 9, 2025 00:32
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css
@danesparza
danesparza / negroni-gorilla.go
Last active December 16, 2020 12:36
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)
@grantmcconnaughey
grantmcconnaughey / pdf.py
Last active February 8, 2021 21:50 — forked from zyegfryed/pdf.py
Outputting PDFs with Django 1.8 and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.core.exceptions import ImproperlyConfigured
from django.template import engines
from django.template.backends.base import BaseEngine
from django.template.engine import Engine, _dirs_undefined
@ayushkr19
ayushkr19 / dir_tree.txt
Last active December 9, 2016 20:43
Server configuration for Django + Gunicorn + Nginx + Supervisor.
Since the aim of this file is just to show the directory structure, some files have been removed
For example, the __pychache()__ directory, the virtualenv files, the static files etc
ayush@host:/$ tree webapps/
webapps/
`-- djangouser
|-- DjangoProjects
| `-- SpellPlay-Server
| `-- spellplay
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@mozillazg
mozillazg / supervisord.service
Last active March 16, 2025 07:43 — forked from tonyseek/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@javilobo8
javilobo8 / download-file.js
Last active May 13, 2025 05:55
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@asukakenji
asukakenji / 0-go-os-arch.md
Last active June 27, 2025 12:52
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android