Skip to content

Instantly share code, notes, and snippets.

View vgoltv's full-sized avatar

Viktor Goltvyanytsya vgoltv

View GitHub Profile
@yannickl
yannickl / YLColor.swift
Last active September 16, 2023 03:55
Hex string <=> UIColor conversion in Swift
import Foundation
import UIKit
extension UIColor {
convenience init(hexString:String) {
let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
let scanner = NSScanner(string: hexString)
if (hexString.hasPrefix("#")) {
scanner.scanLocation = 1
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active July 19, 2024 20:02 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@squatto
squatto / certificate_renewal.py
Last active August 15, 2018 13:53
Webfaction letsencrypt automatic certificate renewal and installation
#!/usr/local/bin/python
from os import chdir, environ, getcwd, listdir, stat
from sys import exit, argv
from subprocess import Popen, PIPE
from xmlrpclib import ServerProxy, Fault
@jsnelders
jsnelders / wordpress_export_to_json.php
Last active May 6, 2024 16:35
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@malcommac
malcommac / TheMovieDB.swift
Created March 15, 2022 12:39
TheMovieDB Example in RealHTTP
public class MovieDBTest: XCTestCase {
/// The shared client with their settings.
private lazy var client: HTTPClient = {
client = HTTPClient(baseURL: "https://api.themoviedb.org/3")
// it will happens value to each call.
client.queryParams = [
.init(name: "api_key", value: "<API KEY>"),
.init(name: "language", value: "IT-it")