Skip to content

Instantly share code, notes, and snippets.

var url = "https://api.github.com/repos/awesomeWM/awesome/issues/1395/comments"
var httpRequest
window.document.onload = function makeRequest(url) {
httpRequest = new XMLHttpRequest()
if (!httpRequest) {
console.log('Browser do not support an ajax call.')
return false
}
@aajjbb
aajjbb / atom-intern.h
Created September 22, 2016 23:18
atom-intern.h
/* This file is autogenerated by /home/morpho/Devel/awesome-build/awesome/build-utils/atoms-int.sh - do not edit */
xcb_atom_t _NET_SUPPORTED
;
xcb_atom_t _NET_STARTUP_ID
;
xcb_atom_t _NET_CLIENT_LIST
;
xcb_atom_t _NET_CLIENT_LIST_STACKING
;
@aajjbb
aajjbb / Dynamic Median.cpp
Created September 6, 2016 03:44
dynamic median
//Get median of a sequence in O(log(n))
void balance() {
while (abs((int) (minHeap.size() - maxHeap.size())) > 1) {
if (minHeap.size() > maxHeap.size()) {
int tmp = minHeap.top();
minHeap.pop();
maxHeap.push(tmp);
} else {
int tmp = maxHeap.top();
maxHeap.pop();
@aajjbb
aajjbb / Dynamic Median
Created September 6, 2016 03:43
median.cpp
//Get median of a sequence in O(log(n))
void balance() {
while (abs((int) (minHeap.size() - maxHeap.size())) > 1) {
if (minHeap.size() > maxHeap.size()) {
int tmp = minHeap.top();
minHeap.pop();
maxHeap.push(tmp);
} else {
int tmp = maxHeap.top();
maxHeap.pop();
//Get median of a sequence in O(log(n))
void balance() {
while (abs((int) (minHeap.size() - maxHeap.size())) > 1) {
if (minHeap.size() > maxHeap.size()) {
int tmp = minHeap.top();
minHeap.pop();
maxHeap.push(tmp);
} else {
int tmp = maxHeap.top();
maxHeap.pop();
function spawn_once(command, class, tag)
-- create move callback
local callback
callback = function(c)
if c.name == class then
awful.client.movetotag(tag, c)
client.disconnect_signal("manage", callback)
end
end
client.connect_signal("manage", callback)
bool searchMatrix(vector<vector<int>>& matrix, int target) {
N = (int) matrix.size();
M = (int) matrix[0].size();
return search(matrix, target, 0, 0, N - 1, M - 1);
}
bool in(int l, int r, int m) {
return m >= l && r >= m;
}
bool searchMatrix(vector<vector<int>>& matrix, int target) {
N = (int) matrix.size();
M = (int) matrix[0].size();
return search(matrix, target, 0, 0, N - 1, M - 1);
}
bool in(int l, int r, int m) {
return m >= l && r >= m;
}
-- On rc.lua
function spawn_once(command, class, tag)
-- create move callback
local callback
callback = function(c)
if c.name == class then
awful.client.movetotag(tag, c)
client.disconnect_signal("manage", callback)
end
end
"""
aajjbb
python3 script based on ricbit script to dowload all books from computer science section of Springer
It has BeautifulSoup as dependency, easy installed with 'pip install beautifulsoup4'
"""
import re, subprocess, time, sys