Skip to content

Instantly share code, notes, and snippets.

View oshliaer's full-sized avatar
😼
Cat face with wry smile

Alex Ivanov oshliaer

😼
Cat face with wry smile
View GitHub Profile
@oshliaer
oshliaer / timeout-destroy.htm
Created January 24, 2017 16:27 — forked from bennadel/timeout-destroy.htm
Don't Forget To Cancel $timeout Timers In Your $destroy Events In AngularJS
<!doctype html>
<html ng-app="Demo" ng-controller="DemoController">
<head>
<meta charset="utf-8" />
<title>
Don't Forget To Cancel $timeout Timers In Your $destroy Events In AngularJS
</title>
</head>
<body>
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@oshliaer
oshliaer / i3-get-window-criteria
Created January 9, 2017 12:25 — forked from jottr/i3-get-window-criteria
Get window criteria to use with i3 window placement. Taken from: http://bit.ly/1e9pcfe
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
@oshliaer
oshliaer / queryASpreadsheet.gs
Created January 8, 2017 22:02 — forked from rudimusmaximus/queryASpreadsheet.gs
Follow up to Totally UnScripted Episode 3: SQL like queries in Google Apps Script
/**
* quickly test our function
*/
function test(){
var result = queryASpreadsheet('1sPevvtTMSd9LUptX8qdsw4VJf07nOal_1qn9JLwO4fQ',
'Example Data',
'A1:C',
'SELECT A,B,C WHERE B < 7');
var rows = result.length;//7
@oshliaer
oshliaer / zenburn.py
Created January 5, 2017 11:49 — forked from ivoarch/zenburn.py
Zenburn like colorscheme for https://github.com/hut/ranger .
# Ivaylo Kuzev <ivkuzev@gmail.com>, 2014
# Zenburn like colorscheme for https://github.com/hut/ranger .
# default colorscheme.
# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lepus.uberspace.de>
# This software is distributed under the terms of the GNU GPL version 3.
from ranger.gui.colorscheme import ColorScheme
from ranger.gui.color import *
@oshliaer
oshliaer / JS.html
Last active March 30, 2016 21:01 — forked from anonymous/JS.html
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#addButton').click(addPosition);
});
function addPosition() {
var posCount = $('#positions').children().length + 1;
$('#positions').children().last().after("<div id='position" + posCount + "'>" + $('#position').html() + "<span onclick='removPosition(event)'>[X]</span></div>");
}
cache = CacheService.getPublicCache();
ss = SpreadsheetApp.getActiveSpreadsheet();
tsheet = ss.getSheets()[0];
userslist = [];
n = 1;
r = 0;
deep = '';
@oshliaer
oshliaer / Code.gs
Created January 14, 2016 19:28 — forked from erickoledadevrel/Code.gs
Polling in a sidebar only when the page is visible
function onOpen() {
SpreadsheetApp.getUi().createMenu('Testing')
.addItem('Show Sidebar', 'showSidebar')
.addToUi();
}
function showSidebar() {
var sidebar = HtmlService.createHtmlOutputFromFile('Sidebar')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setTitle('Sidebar');