Skip to content

Instantly share code, notes, and snippets.

View kindy's full-sized avatar

Kindy Lin kindy

  • Beijing, China
  • 08:42 (UTC +08:00)
  • LinkedIn in/kindy
View GitHub Profile
@devyn
devyn / trie.c
Created November 13, 2012 06:56
#include "trie.h"
void trie_create (trie_t **trie, char edgeName, trie_t *previousSibling, trie_t *parent)
{
*trie = calloc(1, sizeof(struct trie));
(*trie)->edgeName = edgeName;
if (previousSibling == NULL) {
if (parent != NULL) parent->firstChild = *trie;
@dxflygao
dxflygao / trie.c
Created November 13, 2012 07:32 — forked from devyn/trie.c
#include "trie.h"
void trie_create (trie_t **trie, char edgeName, trie_t *previousSibling, trie_t *parent)
{
*trie = calloc(1, sizeof(struct trie));
(*trie)->edgeName = edgeName;
if (previousSibling == NULL) {
if (parent != NULL) parent->firstChild = *trie;
@rtrcolin
rtrcolin / jiraRefreshTickets.js
Last active January 8, 2024 13:59
Super simple Google Docs integration with Jira Issues/Tickets
// URL for Jira's REST API for issues
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/";
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true
var fetchArgs = {
contentType: "application/json",
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"},
muteHttpExceptions : true
};
@mbostock
mbostock / .block
Last active February 26, 2019 22:35
Rotating Voronoi
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/rotating-voronoi
@Integralist
Integralist / regex.js
Created March 11, 2013 15:15
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]
@mashpie
mashpie / i18n-express-mustache-app.js
Last active September 26, 2018 16:31
express + i18n-node + mustache (via consolidate.js) and avoid concurrency issues
// require modules
var express = require('express'),
i18n = require('../../i18n'),
url = require('url'),
cons = require('consolidate'),
app = module.exports = express();
// minimal config
i18n.configure({
locales: ['en', 'de'],
@mkottman
mkottman / cacert.pem
Last active April 10, 2020 13:44
A simple Lua IMAP client. Prerequisites: LuaSocket and LuaSec
##
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
##

Google Apps Script Document Utilities

  • getAllLinks.js

  • getAllLinks(element) - returns array of all UrlLinks in Document

  • findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document

  • changeCase.js - Document add-in, provides case-change operations in the add-in Menu.

  • onOpen - installs "Change Case" menu

  • _changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.

  • helper functions for five cases

@XVilka
XVilka / TrueColour.md
Last active April 27, 2025 10:17
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations