Skip to content

Instantly share code, notes, and snippets.

@htuscher
htuscher / .gitlab-ci.yml
Created August 3, 2017 08:12
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@sstevan
sstevan / socksimap.py
Last active February 19, 2024 04:59
Python (v2 - v3) - IMAP through SOCKS proxy using PySocks module
import ssl
from socks import create_connection
from socks import PROXY_TYPE_SOCKS4
from socks import PROXY_TYPE_SOCKS5
from socks import PROXY_TYPE_HTTP
from imaplib import IMAP4
from imaplib import IMAP4_PORT
from imaplib import IMAP4_SSL_PORT
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

public class ParallaxPageTransformer implements ViewPager.PageTransformer {
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(1);
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(0);
} else if (position <= 1) { // [-1,1]
@lzanita09
lzanita09 / ParallaxViewtransformer.java
Created May 10, 2014 15:08
Custom PageTransformer simulates Yahoo News Digest ViewPager animation.
import android.support.v4.view.ViewPager;
import android.view.View;
/**
* Custom PageTransformer simulates Yahoo News Digest ViewPager animation.
*
*
* Created by zhelu on 2/27/14.
*/
public class ParallaxViewTransformer implements ViewPager.PageTransformer {
@chrcoe
chrcoe / AESCipher.py
Last active November 29, 2021 09:03
PyCrypto AES using ECB mode implementation in Python 3.3. This uses very basic 0x00 padding, I would recommend PKCS5/7
'''
Created on Mar 20, 2014, uses PyCrypto/Python 3.3
@author: Chris Coe
'''
import binascii
from Crypto.Cipher import AES
class AESCipher:
'''
@crmccreary
crmccreary / AESCipher.py
Created May 20, 2013 02:17
Encryption using pycrypto, AES, and PKCS5 padding
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__( self, key ):
"""
@pfote
pfote / AesCrypt.py
Created March 6, 2013 13:01
AES256 with PKCS5 padding
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import random
import hashlib
import os
class AesCrypt256: