Skip to content

Instantly share code, notes, and snippets.

View artemgordinskiy's full-sized avatar

Artem Gordinskiy artemgordinskiy

View GitHub Profile
@april
april / arena-macos-fixes.sh
Last active May 29, 2024 23:24
Fixes Magic Arena's broken full screen implementation on macOS
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
# to find the scaled resolutions, go to System Preferences --> Display and then
# divide the width by 16 and multiple by 9. on my personal system this ends up
@artemgordinskiy
artemgordinskiy / trigger_customer_io_event_with_attachments.py
Last active August 6, 2018 09:13
Trigger Customer.io event with attachments in Python
import base64
import requests
from customerio import CustomerIO
file_content = requests.get(file_url).content
file_base64 = base64.b64encode(file_content)
customer_io = CustomerIO(site_id, api_key)
customer_io.track(
@esseti
esseti / Timer
Created January 14, 2016 22:08
TimerApp script to set slack "Do Not Disturb" during a pomodor and rest when finished.
#replace xoxp-*****000 with your token from here https://api.slack.com/web#authentication
# for the start
do shell script "curl 'https://slack.com/api/dnd.setSnooze?token=xoxp-*****000&num_minutes=$duration'"
# for the end and interuption
do shell script "curl https://slack.com/api/dnd.endSnooze?token=xoxp-*****000"
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@katio
katio / resig-netflix-inheritance.js
Last active April 23, 2018 22:45
From @dylanthehuman's article: (http://techblog.netflix.com/2014/05/improving-performance-of-our-javascript.html) about Netflix's improved version of John Resig's "simple-javascript-inheritance" (http://ejohn.org/blog/simple-javascript-inheritance/)
/* Simple JavaScript Inheritance with NFE's
* MIT Licensed.
*/
// Inspired by base2 and Prototype and John Resig's class system
(function(){
var initializing = false;
// The base Class implementation (does nothing)
this.Class = function(){};
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 09:57
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@johntyree
johntyree / getBlockLists.sh
Last active June 4, 2024 12:30
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@codiez
codiez / itunes_notifications.py
Created December 20, 2009 20:14
Listen for distributed notifications from iTunes of the current song
'''
This python script listens for distributed notifications from iTunes of new songs playing,
works alot better then constantly polling.
'''
import Foundation
from AppKit import *
from PyObjCTools import AppHelper
class GetSongs(NSObject):
def getMySongs_(self, song):
@peterc
peterc / urlmonitor
Created April 4, 2009 01:30
urlmonitor - print out the URLs requested system wide on the main network interface
# urlmonitor - print out the URLs requested system wide on the main network interface
# Accept a network interface name as an optional argument
iface = ARGV.first
# No interface specified? Try to guess which one is king..
unless iface
`ifconfig -l`.split.each do |iface|
next if iface =~ /^lo/
break if `ifconfig #{iface}` =~ /inet (0|1|2)/