Skip to content

Instantly share code, notes, and snippets.

View subak's full-sized avatar

Subak Systems subak

  • Subak Systems
  • Japan
View GitHub Profile
@azu
azu / markdown.md
Created February 24, 2012 14:36
markdownで書かれたmarkdownチートシート

Code - コードの挿入

puts 'The best way to log and share programmers knowledge.'

puts 'The best way to log and share programmers knowledge.'

また、コードをインライン表示することも可能です。

@ysugimoto
ysugimoto / lazy.js
Last active December 14, 2015 19:49
Deferred pattern implements
(function(module) {
"use strict";
// Scope stacks
var LAZY_ID = 0,
PARALLELS = [];
// exports
module.Lazy = Lazy;
@ahomu
ahomu / extendClass.js
Last active December 16, 2015 17:50
継承脳乙
'use strict'
var DEFINE_NOT_WRITABLE = {writable: false};
/**
* Base Class of OOP feature
*
// e.g 1
var Klass = klass.of({
constructor: function() {
@khrome
khrome / gist:7d87534748545f576fd2
Last active September 16, 2023 17:33
__dirname in the browser
(function(){ //make __dirname, __filename work in the browser
if(window && !window['__dirname']){
var stackTrace = function () {
var lines = (new Error()).stack.split("\n");
// 0 = message, 1 = stackTrace
lines.shift(); lines.shift();
var result = lines.map(function(line){
if(line.indexOf('(native)') != -1){
return {
@meitinger
meitinger / asterisk-13.2.0-win.patch
Last active November 29, 2021 12:49
Compile guide for Asterisk on Cygwin.
diff -ru asterisk-13.2.0-orig/apps/Makefile asterisk-13.2.0-patched/apps/Makefile
--- asterisk-13.2.0-orig/apps/Makefile 2013-04-15 18:43:47.000000000 +0200
+++ asterisk-13.2.0-patched/apps/Makefile 2015-03-24 03:28:53.684406200 +0100
@@ -34,6 +34,6 @@
$(subst .c,.o,$(wildcard confbridge/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,app_confbridge)
ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
- LIBS+= -lres_features.so -lres_ael_share.so -lres_monitor.so -lres_speech.so
+ LIBS+= -lres_stasis.so -lres_ael_share.so -lres_monitor.so -lres_speech.so
LIBS+= -lres_smdi.so
@atsu666
atsu666 / gist:bdcf6197fa21ac534e8c
Created October 30, 2015 03:11
a-blog cmsのキャッシュ処理周り
//-------
// cache
define('ZIP_USE', !DEBUG_MODE and !!ZIP_ENABLE and ('on' == config('zip_http')));
if ( 1
and !DEBUG_MODE
and ('on' == config('cache'))
and (!SID or (config('subscriber_cache') === 'on' and ACMS_RAM::userAuth(SUID) === 'subscriber' and !$Q->get('admin')))
and !(is_ajax() and config('ajax_nocache') === 'on' and $GetQuery->get('nocache') === 'yes')
and !HTTPS
and !ACMS_POST
@kumatti1
kumatti1 / hoge.cpp
Last active April 29, 2019 09:02
メモ帳のウィンドウ制御
#include <stdio.h>
#include <windows.h>
void hoge()
{
HWND hwnd = FindWindowW( L"Notepad", L"無題 - メモ帳");
if(!hwnd){
MessageBoxW(0, L"", L"メモ帳未起動!", MB_OK);
_wsystem(L"c:\\windows\\system32\\notepad.exe");
@dtolb
dtolb / jssip.md
Last active December 15, 2023 10:46
JsSip Demo

JSSIP with Catapult API

⚠️ This has been updated at JsFiddle*

Prerequisites

  • Register for a Catapult (Bandwidth Application Platform) account here
  • Register a SIP domain
  • Create an endpoint/user
  • If you want to make calls to the PSTN (normal phones) you will need a server to handler events from Catapult
@lwrage
lwrage / highlighting-kate.html
Created January 27, 2017 19:11
highlighting-kate vs. skylighting
<head><title>highlighttest.aadl</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="generator" content="highlight-kate"><style type="text/css">div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */

WIP某所で喋るための草稿。

Testable JavaScript

当たり前のことを書く。当たり前のことが、当たり前にできない人へ。JavaScriptだから、当たり前のことをしなくていいと思っている人達へ。

基本方針

  • それぞれのファイルは、可能な限り参照透過な関数を提供する
  • それぞれのファイルは、読み込んだだけでは副作用を起こさない