Skip to content

Instantly share code, notes, and snippets.

View addlistener's full-sized avatar
:accessibility:
Sleeping

addlistener

:accessibility:
Sleeping
View GitHub Profile
@chriseidhof
chriseidhof / nsincrementalstore.markdown
Created February 18, 2012 16:39
Accessing an API using CoreData's NSIncrementalStore

Accessing an API using CoreData's NSIncrementalStore

Note: the original location of this article is on my blog, however, it is posted here too for better readability.

In this article, we will see how to use Core Data for accessing your API. We will use the Bandcamp API as our running example. I've only been experimenting with this code for a few days, so there might be mistakes in there.

@rojotek
rojotek / DataManager.h
Created April 11, 2012 20:59 — forked from AlexAstroCat/DataManager.h
Core Data singleton manager class capable of being run from a static library - updated for ARC.
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}
@stefanmaric
stefanmaric / btn-pill.less
Last active December 16, 2015 03:21
.btn-pill class in LESS to include with Bootstrap's less files.
// Button styles
// -------------------------
// Pill button variants
.btn.btn-pill {
// border-radius depends on button' height
@border-radius-pill: (@font-size-base * @line-height-base + @padding-base-vertical * 2) / 2;
border-radius: @border-radius-pill;
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active April 23, 2025 09:52 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@sampsyo
sampsyo / fib.ts
Last active August 9, 2023 23:54
function inheritance in TypeScript
// This is a quick demonstration of "function inheritance" as described in
// this paper from Daniel Brown and William Cook.
// http://www.cs.utexas.edu/users/wcook/Drafts/2009/sblp09-memo-mixins.pdf
// Expressed in TypeScript (and without the monads).
// Syntax note: When you write function types in TypeScript, you need to name
// each parameter. But the names don't actually matter, so I just use _. You
// can read `(_:A) => B` as `a -> b` in ML or Haskell syntax.
// In Brown and Cook's Haskell, `type Gen a = a -> a` is a "generator." The
@codito
codito / pyembed.c
Last active March 16, 2024 20:29
A simple embedded python interpreter
// Demo a simple embedded python interpreter
// See this post for context: http://codito.in/notes-on-vim-python-interop
//
// Compile with: gcc $(python-config --cflags --ldflags) pyembed.c -o pyembed
// Tested on python 3.6 in arch linux
//
// See https://docs.python.org/3/c-api/init.html for details of APIs.
//
#include <Python.h>
@imba-tjd
imba-tjd / .Cloud.md
Last active April 24, 2025 14:43
☁️ 一些免费的云资源

  • IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装。PaaS提供语言环境和框架(可以自己选)。SaaS只能使用开发好的软件(卖软件本身,如税务会计、表格文字处理)。BaaS一般类似于非关系数据库,但各家不通用
  • 云服务的特点:零前期成本 & 按需付费 & 弹性(类似于租,可随时多加、退掉;但没有残值)、高可用(放在机房中,不同AZ间水电隔离)

其他人的集合

@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 23, 2025 10:17
ChatPDF-zh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamlacombe
adamlacombe / cloudflare_zone_token_generator.sh
Last active February 29, 2024 07:04
This bash script automates the process of creating a Cloudflare API token with full zone permissions. It fetches all permission groups that have a scope related to zones. Once the appropriate permission groups are retrieved, the script creates a new API token with these permissions for a specific zone, which is defined by the ZONE_ID variable. A…
#! /bin/bash
# 1) Make file executable: chmod +x cloudflare_zone_token_generator.sh
# 2) Set variable values: API_KEY, EMAIL_ADDRESS, ZONE_ID
# 3) ./cloudflare_zone_token_generator.sh
# Global API Key: https://dash.cloudflare.com/profile/api-tokens
API_KEY=""
# Email address associated with your account