Skip to content

Instantly share code, notes, and snippets.

Avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
@Gozala
Gozala / AnIntro.md
Created May 30, 2017 — forked from chrisdone/AnIntro.md
Statically Typed Lisp
View AnIntro.md

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

@Gozala
Gozala / Focus.elm
Last active Aug 20, 2016 — forked from debois/Proposal.elm
Declarative focus management API
View Focus.elm
{-| Focus management is not a trivial task, but luckly most of it's logic can be fully self
contained by principrals of Elm archituture.
-}
import Html exposing (Attribute, Html)
import Html.Attributes exposing (attribute)
import Html.Events
import Setting exposing (setting)
@Gozala
Gozala / git-gpg.md
Created Apr 12, 2016 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
View git-gpg.md
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)
  2. Generate a key: $ gpg --gen-key
  3. Take the defaults. Whatevs
  4. Tell gpg-agent to use pinentry-mac:
$ vim ~/.gnupg/gpg-agent.conf 
View gist:5584873
// Button is a high level construct that can be used
// to define button types with a specific behaviors
let { Button } = require("sdk/ui");
// Button with specicic behavior can be defined by passing a function
// defining a behaivor of a button on the specific state changes.
var button = Button(function behavior(state, {owner}) {
// First argument represents current `state` snapshot for the button
// in the context of the given `options.owner` window.
@Gozala
Gozala / API-Overview.md
Last active Dec 16, 2015 — forked from ZER0/gist:5209412
Direct page to add-on communication
View API-Overview.md

Consider following example where:

A - addon

B - evil.com

  • C - good.com

Related material

View tweets.js
// This is in response to https://gist.github.com/Peeja/5284697.
// Peeja wanted to know how to convert some callback-based code to functional
// style using promises.
var Promise = require('rsvp').Promise;
var ids = [1,2,3,4,5,6];
// If this were synchronous, we'd simply write:
View gist:4637925
var obj = {
_discoverScriptsAndSources: function TA__discoverScriptsAndSources() {
let scriptsAdded = [];
for (let s of this.dbg.findScripts()) {
if (!this._allowSource(s.url)) {
continue;
}
scriptsAdded.push(this._addScript(s));
@Gozala
Gozala / iframe.js
Created Dec 11, 2012 — forked from anonymous/iframe.js
Updated version
View iframe.js
let { Cc, Ci } = require('chrome');
let appShellService = Cc['@mozilla.org/appshell/appShellService;1'].
getService(Ci.nsIAppShellService);
let service = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
let window = appShellService.hiddenDOMWindow;
let document = window.document;
let XUL = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'
@Gozala
Gozala / case.js
Created Nov 6, 2012 — forked from isaacs/case.js
npm testcase
View case.js
var npm = require("npm")
var path = require("path")
npm.load({ prefix: path.join(process.env.HOME, ".orchestrator") }, function(e, npm) {
npm.commands.ls([], function(err, _) {
// this time it's nothing but probably results are cached
npm.commands.install(["method"], function(err, _) {
// now there is something but it still thinks there is nothing.
npm.commands.ls([], console.log)
})
@Gozala
Gozala / derp-modules.js
Created Oct 11, 2012 — forked from gordonbrander/derp-modules.js
Simple, tiny, dumb JavaScript Modules
View derp-modules.js
(function(exports) {
// Simple, tiny, dumb module definitions for Browser JavaScript.
//
// What it does:
//
// * Tiny enough to include anywhere. Intended as a shim for delivering
// browser builds of your library to folks who don't want to use script loaders.
// * Exports modules to `__modules__`, a namespace on the global object.
// This is an improvement over typical browser code, which pollutes the
// global object.