Skip to content

Instantly share code, notes, and snippets.

View lxsameer's full-sized avatar

Sameer Rahmani lxsameer

View GitHub Profile
@lxsameer
lxsameer / myweechat.md
Created July 27, 2018 18:06 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

(set-fontset-font "fontset-default"
(cons (decode-char 'ucs #x0627)
(decode-char 'ucs #x0649))
"Nazanin")
(set-fontset-font "fontset-default"
(cons (decode-char 'ucs #xFE8D)
(decode-char 'ucs #xFEF0))
"Nazanin")
@lxsameer
lxsameer / gist:df9613c7145dbc41c43e17618e926dac
Created April 15, 2018 17:22 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview

Keybase proof

I hereby claim:

  • I am lxsameer on github.
  • I am lxsameer (https://keybase.io/lxsameer) on keybase.
  • I have a public key whose fingerprint is 90A4 D413 6DB8 9738 9C65 DC37 05C6 3462 DD06 77B5

To claim this, I am signing this object:

@lxsameer
lxsameer / task.yml
Created January 11, 2018 12:29 — forked from maxim/task.yml
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
;; NOTE: In order to run this code you need Lein >= 2 and
;; Clojure 1.9.0-alpha20 and org.clojure/test.check "0.10.0-alpha2"
;; Basically fire up a repl and evaluate this file.
(ns flat.core
(:require [clojure.spec.alpha :as spec]
[clojure.spec.test.alpha :as st])
(:gen-class))
(defn flat
;annotation syntax
(import [java.lang.annotation Retention RetentionPolicy Target ElementType]
[javax.xml.ws WebServiceRef WebServiceRefs])
(definterface Foo (foo []))
;annotation on type
(deftype ^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"]
@lxsameer
lxsameer / WebSockets.md
Created July 21, 2017 15:54 — forked from subudeepak/WebSockets.md
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
(require 'tubular.core)
(tubular.core/connect "127.0.0.1" REPL_PORT)
@lxsameer
lxsameer / pub-sub.js
Created December 7, 2016 10:59 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");