Skip to content

Instantly share code, notes, and snippets.

View andkon's full-sized avatar
🤠

Andrew Konoff andkon

🤠
View GitHub Profile
@nguyentruongky
nguyentruongky / Gradient_border_button.md
Last active May 31, 2023 00:00
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.

@aparrish
aparrish / spacy_intro.ipynb
Last active August 9, 2023 01:41
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ppamorim
ppamorim / ImageInsets.swift
Created November 5, 2015 16:30
Add padding/margin at a image!
import UIKit
extension UIImage {
func imageWithInsets(insetDimen: CGFloat) -> UIImage {
return imageWithInset(UIEdgeInsets(top: insetDimen, left: insetDimen, bottom: insetDimen, right: insetDimen))
}
func imageWithInset(insets: UIEdgeInsets) -> UIImage {
UIGraphicsBeginImageContextWithOptions(
CGSizeMake(self.size.width + insets.left + insets.right,
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

from sqlalchemy import engine
from sqlalchemy import event
class DbStats():
def __init__(self):
self.clear()
def clear(self):
self.total_queries = 0
self.total_time = 0
@wetzler
wetzler / gist:6909882
Last active May 16, 2020 13:13
This gist shows you how to run a retention analysis. I blogged about how to run a retention analysis here: https://keen.io/blog/47823687779/how-to-do-a-retention-analysis/
require 'rubygems'
require 'keen'
require 'json'
require 'date'
require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week
require 'simple_xlsx' #for outputting excel files
require 'cgi' #for URL encoding
#================================oOo===================================
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@stash
stash / press.md
Last active December 15, 2015 20:40
French Press Method

French Press Coffee

  • grind super coarse
  • add just enough boiling water to cover grounds. Steep for 30s.
  • fill press to top. Stir to get a good vortex, which will pull the grounds down into a "cone" on the bottom.
  • Leave for ~5mins
  • skim floating grounds off the top with a spoon
  • press
@gdamjan
gdamjan / cal.py
Created December 7, 2012 04:52
use the calendar google-api from python as a service
'''
Go to https://code.google.com/apis/console/ and:
- create a new project,
- enable access to the calendar api,
- create a "service account" - that will give you an:
* "email address" which is the service_account_name and
* a private key that you need to save on you server
- go to the calendar and share it with the "email address" from above
Make sure your time is synchronized.
@lukaslundgren
lukaslundgren / python27_on_debian.sh
Created May 11, 2012 12:58
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..