Skip to content

Instantly share code, notes, and snippets.

View Askhento's full-sized avatar
🏠
Working from home

Askhat Mudarisow Askhento

🏠
Working from home
View GitHub Profile
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@skarfacegc
skarfacegc / moomDev.applescript
Last active December 19, 2020 18:39
tell Moom to load a specific arrangement

I've moved to using slate rather than moom

I like to have certain window layouts for different tasks. when I'm coding I like it setup one way, email is another, etc. Being able to swap to these layouts with launchbar is cool.

I'm sure it works in butler, qsb, and quicksilver as well, just havent tested

Make the above into applescript save to Application Support/Launchbar/Actions

@JeffPaine
JeffPaine / make_github_issue.py
Created July 19, 2012 17:24
Make an issue on github using API V3 and Python
import json
import requests
# Authentication for user filing issue (must have read/write access to
# repository to add issue to)
USERNAME = 'CHANGEME'
PASSWORD = 'CHANGEME'
# The repository to add this issue to
REPO_OWNER = 'CHANGEME'
@trent-boyd
trent-boyd / arrange-windows.applescript
Created February 9, 2013 01:24
Applescript: Arrange Windows w/ Moom
-- Move to Space 1
tell application "System Events" to keystroke (key code 105)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Development Panel"
-- Move to Space 2
tell application "System Events" to keystroke (key code 107)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Communication Panel"
@fliptheweb
fliptheweb / get_currency.js
Last active November 13, 2020 02:04
Google Sheets Macros (Google App Script) for getting currency of number cell
CURRENCY_MAP = {
'$': 'USD',
'₽': 'RUB', // there is a missing character in editor font
'€': 'EUR',
'฿': 'THB'
}
function _formatToCurrency(formatString) {
var currencyRegexp = /\[.*(.)\]/g;
var currency = currencyRegexp.exec(formatString)[1];
@Gozala
Gozala / Readme.md
Last active June 8, 2023 07:31
Range hilighting code using getClientRects API

Highlight Selection Ranges

Code here takes a DOM Selection Range instance and creates a highlighting for it by using getClientRects. Approach was inspired by marks although here function attempts to find nearest positioned parent element to the commonAncestorContainer and draw all the highilighting rectangles there, this avoids issues with an overflowing content.

Issues

  • Approach ignores z-index which isn't great as some element might be overlaying the selection in which case it should not appear, but it does if we use high z-index value. If we use low z-index value then some elements (possibly ones containing selection) might end up overlaying selection itself.
  • Rendered selections are scattered all o
@amanjuman
amanjuman / SoftEther VPN Server Setup in Raspberry Pi 3
Last active October 18, 2023 05:20
SoftEther VPN Server Setup in Raspberry Pi 3
sudo su
cd /root/
wget https://www.softether-download.com/files/softether/v4.34-9745-rtm-2020.04.05-tree/Linux/SoftEther_VPN_Server/32bit_-_ARM_EABI/softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz
tar xzf softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz && rm softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz
cd vpnserver && sudo make
cd ..
sudo mv vpnserver /usr/local && cd /usr/local/vpnserver/
sudo chmod 600 *
@AzureDVBB
AzureDVBB / node_trees.py
Created July 17, 2018 21:22
A simple node tree addon template for blender.
# the little less documented way of adding a custom node tree
# and populate it with nodes of varying types of I/O
# sockets that work together, discombobulated
# first we import the blender API
import bpy
# then we create the UI space, the node tree as it is called
# but in actualy fact this is similar to a UI panel/menu
@torufurukawa
torufurukawa / google-script-run-promise.js
Last active October 20, 2023 10:13
Make google.script.run looks a promise
// Converted https://gist.github.com/shrugs/44cfb94faa7f09bcd9cb for ES6
function scriptRunPromise() {
const gs = {};
// google.script.run contains doSomething() methods at runtime.
// Object.keys(goog.sscript.run) returns array of method names.
const keys = Object.keys(google.script.run);
// for each key, i.e. method name...
@estruyf
estruyf / vscode-theme-variables.css
Created January 28, 2022 13:21
All VS Code theme variables
:root {
--vscode-font-weight:normal;
--vscode-font-size:13px;
--vscode-editor-font-family:"Operator Mono Lig", "Cascadia Code";
--vscode-editor-font-weight:normal;
--vscode-editor-font-size:15px;
--vscode-foreground:#f3eff5;
--vscode-errorForeground:#f48771;
--vscode-descriptionForeground:rgba(243, 239, 245, 0.7);
--vscode-icon-foreground:#c5c5c5;