Skip to content

Instantly share code, notes, and snippets.

@Bogidon
Bogidon / LICENSE
Last active February 7, 2017 07:11
Create UIColor object from hexadecimal strings. Pure Swift
The MIT License (MIT)
Copyright (c) 2017 Bogdan Vitoc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Bogidon
Bogidon / ESBStoryboards.swift
Last active August 18, 2016 01:05
EasyStoryboards – a better way to manage storyboards and avoid merge conflicts
//
// Storyboards.swift
//
// Created by Bogdan Vitoc on 7/5/16.
// Copyright © 2016 Bogdan Vitoc. All rights reserved.
//
// ⚠️ this is an example only
// ⚠️ modify the properties and strings to suit your project
@Bogidon
Bogidon / add_envs_circleci.js
Last active August 17, 2016 18:57
Automate adding environment variables to CircleCI
// 1. Go to env vars page in project settings
// 2. Fill in info below
// 3. Paste contents into your browser's developer console
var envs = //your object with KEY:VALUE
var i = 0;
var keys = Object.keys(envs)
function recurse() {
var key = keys[i]
@Bogidon
Bogidon / UIView+RevealFromLeading.swift
Last active May 12, 2016 22:53
Animate the reveal of a UIView from the leading side.
//
// UIView+RevealFromLeading.swift
// VitocDev
//
// Created by Bogdan Vitoc on 5/12/16.
// Copyright © 2016 VitocDev. All rights reserved.
//
import UIKit
flywheelsTBH(50, 0.40) // start flywheel -- must use chart
basicDrive(127, 127); // start drive
wait1Msec(2000); // wait 2 seconds
basicDrive(0, 0); // stop drive
flywheelsTBH(0, 0.0) // stop flywheel
basicBothIntakes(127); // start intake
wait1Msec(4000); // wait 2 seconds
@Bogidon
Bogidon / js-fiddle-console.css
Created September 16, 2015 14:57
JS Fiddle Console CSS
#console-log {
position: fixed;
bottom: 10px;
left: 10px;
right: 10px;
padding: 10px;
background-color: #eee;
color: #777;
font-family: sans-serif;
}
@Bogidon
Bogidon / js-fiddle-console.js
Created September 16, 2015 14:53
JS Fiddle Console JS
console = {
log: function (text) {
var div = document.getElementById('console-log');
var p = document.createElement("p");
p.innerHTML = text;
div.appendChild(p);
}
};
@Bogidon
Bogidon / fb.js
Last active May 6, 2018 23:05
Facebook group friend requester
// To use this script just go to the members page of the desired facebook group and run it in your web console.
// This script may cease to work in the future. If it does you'll probably just need to change the name of the class.
// I got a warning at about 200 requsts. There's a built in limit of 101 friend requests per run and a rate limiter. Don't know if it had any impact on how quickly I got warned.
// Use at your own risk.
var allButtons = document.getElementsByClassName("uiIconText addButton");
var i = allButtons.length - 1;
function slowLoop() {