Skip to content

Instantly share code, notes, and snippets.

View Apkawa's full-sized avatar
🌴
On vacation

Apkawa Apkawa

🌴
On vacation
View GitHub Profile
@simonsmith
simonsmith / amd-jquery-plugin.js
Last active April 29, 2020 15:28
AMD compatible plugin for jQuery
// UMD dance - https://github.com/umdjs/umd
!function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(root.jQuery);
}
}(this, function($) {
'use strict';
@zacharyvoase
zacharyvoase / README.md
Last active May 21, 2020 06:19
A li’l class for data URI manipulation in Python.

DataURI.py

Data URI manipulation made easy.

This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.

Parsing

@lordfriend
lordfriend / 360px高度
Last active December 19, 2015 00:20
G+左侧边栏图片...
.M8jNpf {
overflow: visible !important;
}
.M8jNpf::before {
position: absolute;
content: url('https://lh6.googleusercontent.com/-KK4uX4DzKDs/UcsJhmwGBtI/AAAAAAAASA8/gpFUyCTqV9Q/w219-h360-no/tsukiko_small.gif');
width: 219px;
height: 360px;
top: 0px;
@rxaviers
rxaviers / gist:7360908
Last active June 4, 2025 22:29
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@rothgar
rothgar / main.yml
Last active April 28, 2025 04:18
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@Nullreff
Nullreff / install-krita.sh
Last active December 25, 2016 03:30
Krita on Debian
#!/bin/sh
# See http://www.davidrevoy.com/article193/guide-building-krita-on-linux-for-cats
# Directory setup
SOURCE=~/src/software/calligra
BUILD=~/src/software/krita
INSTALL=/opt/krita
mkdir -p $SOURCE $BUILD $INSTALL
# Install dependencies
@region23
region23 / golang_books_sites.md
Last active January 5, 2025 14:30
Полезные ресурсы для изучающих Go

На русском языке

Русскоязычные сайты и сообщества

English resources

@pikhovkin
pikhovkin / drawings.py
Last active March 28, 2020 10:06
Patch for openpyxl 2.1.2 for basic reading images. drawings.py and excel.py are in the patch_reader package
# coding: utf-8
from __future__ import absolute_import
import os.path
from io import BytesIO
from openpyxl.xml.constants import (PACKAGE_WORKSHEET_RELS,
REL_NS,
PACKAGE_RELS,
PACKAGE_IMAGES,
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@mjtamlyn
mjtamlyn / cursor.py
Last active December 2, 2021 08:42
Graphene pagination
import functools
from django.db.models import Prefetch, QuerySet
import attr
import graphene
from cursor_pagination import CursorPaginator
from graphene.utils.str_converters import to_snake_case
from graphql_relay import connection_from_list