This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.defineProperty(Object.prototype, 'map', { | |
value: function(f, ctx) { | |
ctx = ctx || this; | |
var self = this, result = {}; | |
Object.keys(self).forEach(function(k) { | |
result[k] = f.call(ctx, self[k], k, self); | |
}); | |
return result; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://stackoverflow.com/questions/1011938/python-previous-and-next-values-inside-a-loop | |
from itertools import tee, islice, chain, izip | |
def previous_and_next(some_iterable): | |
prevs, items, nexts = tee(some_iterable, 3) | |
prevs = chain([None], prevs) | |
nexts = chain(islice(nexts, 1, None), [None]) | |
return izip(prevs, items, nexts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from itertools import izip, count | |
from numpy import loadtxt, ones, convolve | |
import numpy as np | |
import pandas as pd | |
import collections | |
from random import randint | |
data = loadtxt("sunspots.txt", float) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prerequisites (this is what I use, your mileage may vary): | |
Mac OS X 10.10.4 running on iMac13,2 | |
XQuartz (http://xquartz.macosforge.org) | |
PlayOnMac 4.2.8 (https://www.playonmac.com) - N.B. PlayOnLinux available | |
Wine 1.6.2 (downloaded in PlayOnMac) | |
The First Decade (TFD) DVD (Red Alert 2 and Yuri's Revenge) | |
TFD v1.03 revision 4 patch (http://www.cncnz.com/hosted-projects/command-patch/the-first-decade-unofficial-patch/) | |
Updates to latest versions of RA2 and Yuri plus NO-CD, TCP (network play) patch and other goodies | |
Install PlayOnMac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local utils = require 'mp.utils' | |
local msg = require 'mp.msg' | |
-- OPTIONS | |
local keep_file_after_streaming = false | |
local peerflix = { | |
path = "peerflix", | |
searched = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; } | |
REPO="https://github.com/BurntSushi/ripgrep/releases/download/" | |
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name) | |
RELEASE="${RG_LATEST}/ripgrep-${RG_LATEST}-x86_64-unknown-linux-musl.tar.gz" | |
TMPDIR=$(mktemp -d) | |
cd $TMPDIR | |
wget -O - ${REPO}${RELEASE} | tar zxf - --strip-component=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> CarrierMasterData.objects.filter(id=81) // my caching models | |
('GET', '{pp_data_io}q:8f753017faabca24a400ce1477b2d689') | |
('EVALSHA', 'f6b93ec749d56aefa37c49bbc5e7a6eedd0d4ec3', 3, '{pp_data_io}', '{pp_data_io}q:8f753017faabca24a400ce1477b2d689', '', b'\x80\x04\x95\xf9\x07\x00\x00\x00\x00\x00\x00]\x94\x8c\x15django.db.models.base\x94\x8c\x0emodel_unpickle\x94\x93\x94\x8c\x03api\x94\x8c\x11CarrierMasterData\x94\x86\x94\x85\x94R\x94}\x94(\x8c\x06_state\x94h\x01\x8c\nModelState\x94\x93\x94)\x81\x94}\x94(\x8c\x06adding\x94\x89\x8c\x02db\x94\x8c\x07default\x94ub\x8c\x02id\x94KQ\x8c\x04name\x94\x8c\rDHL eCommerce\x94\x8c\tslug_name\x94\x8c\x0fdhl-global-mail\x94\x8c\ncarrier_id\x94\x8c\x06dhleco\x94\x8c\x0caftership_id\x94]\x94(\x8c\x0fdhl-global-mail\x94\x8c\x14dhl-global-mail-asia\x94e\x8c\rcarrier_17_id\x94]\x94(\x8c\x0507048\x94\x8c\x0507047\x94e\x8c\x15carrier_countries_iso\x94]\x94\x8c\x11carrier_countries\x94]\x94\x8c\x10carrier_language\x94\x8c\x02en\x94\x8c\x10carrier_cs_phone\x94\x8c\x0f+1 317 554 5191\x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CacheopsRedisCluster(StrictRedisCluster, CacheopsRedis): | |
get = handle_connection_failure(StrictRedisCluster.get) | |
def __init__(self, *args, **kwargs): | |
init_slot_cache = kwargs.get('init_slot_cache', True) | |
super(CacheopsRedisCluster, self).__init__(*args, **kwargs) | |
# lazy initialize nodes, so that if redis is downed before starting django, everything still fine | |
if not init_slot_cache: | |
self.refresh_table_asap = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Run game or given command in environment | |
# export DXVK_HUD=fps | |
cd "/home/andyhoang/mnt/SteamLibrary/steamapps/common/Grim Dawn" | |
# make sure grim internals located in Grim Dawn folder, not inside x64 | |
DEF_CMD=("/home/andyhoang/mnt/SteamLibrary/steamapps/common/Grim Dawn/GrimInternals64.exe") | |
PATH="/home/andyhoang/.local/share/Steam/steamapps/common/Proton 4.11/dist/bin/:/home/andyhoang/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/bin:/home/andyhoang/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin:/home/andyhoang/.local/share/Steam/ubuntu12_32/steam-runtime/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" \ | |
TERM="xterm" \ |
OlderNewer