Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
@omgbbqhaxx
omgbbqhaxx / bitwalletrecover.py
Created February 26, 2018 22:23 — forked from UdjinM6/bitwalletrecover.py
bitwalletrecover.py - recover compressed private keys from your bitcoin/litecoin/darkcoin wallet. Requires python3, pycoin (https://pypi.python.org/pypi/pycoin), and base58 (https://pypi.python.org/pypi/base58).
## bitwalletrecover.py - recover private keys from your darkcoin wallet
## (this version was not tested with bitcoin/litecoin).
## Requires python3, pycoin (https://pypi.python.org/pypi/pycoin),
## and base58 (https://pypi.python.org/pypi/base58).
##
## Starting with Python 3.4, pip is included by default with the Python binary
## installers. To install pip for older versions 3.x:
##
## sudo apt-get install python3-setuptools
## sudo easy_install3 pip
def verify_sign(public_key_loc, signature, data):
'''
Verifies with a public key from whom the data came that it was indeed
signed by their private key
param: public_key_loc Path to public key
param: signature String signature to be verified
return: Boolean. True if the signature is valid; False otherwise.
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
@omgbbqhaxx
omgbbqhaxx / DownloadAndPlay.swift
Created September 21, 2017 00:11 — forked from wuyongrui/DownloadAndPlay.swift
Download a video and play with AVPlayer,AVPlayerLayer
class ViewController: UIViewController {
private var player:AVPlayer?
private var playerLayer:AVPlayerLayer?
override func viewDidLoad() {
super.viewDidLoad()
print(NSHomeDirectory())
}
def sign_data(private_key_loc, data):
'''
param: private_key_loc Path to your private key
param: package Data to be signed
return: base64 encoded signature
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode, b64decode
@omgbbqhaxx
omgbbqhaxx / Gradient_border_button.md
Created July 3, 2017 15:34 — forked from nguyentruongky/Gradient_border_button.md
A library to create gradient border button

How to draw a gradient border button?

My Problem

Last week, my partner showed me his design for our application. Everything is great, easily implemented with some custom controls. But wait, something is not in my knowledge.

A button with gradient border. Never try it before. Up to now, I just created gradient background views 2 times in previous projects. Googled and found some good results.

@omgbbqhaxx
omgbbqhaxx / Onboard.swift
Created February 10, 2017 16:22 — forked from nazrdogan/Onboard.swift
mamaral/Onboard
//
// AppDelegate.swift
// ecommerce
//
// Created by Nazir Dogan on 10/10/2016.
// Copyright © 2016 Nazir Dogan. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
@omgbbqhaxx
omgbbqhaxx / iOS Swift print all font names
Last active July 24, 2017 15:28 — forked from iamjason/iOS Swift print all font names
Prints out all of the Fonts available. (Helpful for using custom fonts)
for familyName in UIFont.familyNames as [String] {
print("\(familyName)")
for fontName in UIFont.fontNames(forFamilyName: familyName) as [String] {
print("\tFont: \(fontName)")
}
}
@omgbbqhaxx
omgbbqhaxx / RandomString.swift
Created August 23, 2016 11:07 — forked from gingofthesouth/RandomString.swift
Swift 2.2 Random String Generation
// based on https://gist.github.com/samuel-mellert/20b3c99dec168255a046
// which is based on https://gist.github.com/szhernovoy/276e69eb90a0de84dd90
// Updated to work on Swift 2.2
func randomString(length: Int) -> String {
let charactersString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let charactersArray : [Character] = Array(charactersString.characters)
var string = ""
for _ in 0..<length {
@omgbbqhaxx
omgbbqhaxx / timeago.swift
Created July 29, 2016 16:52 — forked from jacks205/timeago.swift
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C) *Swift 2
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components([NSCalendarUnit.Minute , NSCalendarUnit.Hour , NSCalendarUnit.Day , NSCalendarUnit.WeekOfYear , NSCalendarUnit.Month , NSCalendarUnit.Year , NSCalendarUnit.Second], fromDate: earliest, toDate: latest, options: NSCalendarOptions())
if (components.year >= 2) {
return "\(components.year) years ago"
} else if (components.year >= 1){
@omgbbqhaxx
omgbbqhaxx / 00.howto_install_phantomjs.md
Last active May 13, 2016 21:26 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev