Skip to content

Instantly share code, notes, and snippets.

@ShirishRam
ShirishRam / mysql_python.md
Last active October 19, 2023 19:03
Installing MySQL, MySQL connector, MySQL Python client on Mac OS HighSierra

Installing MySQL Python client on Mac using Homebrew and pip

Verify if MySQL server is installed:

$ brew info mysql Expected output: mysql: stable 8.0.12 (bottled)

If you don't have MySQL installed, then run below command:

$ brew install mysql

If you don't have brew installed, then run below command:

@JosephDuffy
JosephDuffy / ExampleViewController.swift
Last active November 30, 2022 18:28
Animates changing the brightness of a `UIScreen`
import UIKit
final class ExampleViewController: UViewController {
private var usersBrightness = UIScreen.main.brightness
private var willEnterForegroundWasCalled = false
private var viewWillDisappearWasCalled = false
override func viewDidLoad() {
@jasonwiener
jasonwiener / movietransitions.swift
Created January 2, 2016 23:13 — forked from SheffieldKevin/movietransitions.swift
Make a movie with transitions with AVFoundation and swift
//
// main.swift
// mutablecomposition
//
// Created by Kevin Meaney on 24/08/2015.
// Copyright (c) 2015 Kevin Meaney. All rights reserved.
//
import Foundation
@ncerezo
ncerezo / FileUploader.swift
Last active November 30, 2022 03:17
Alamofire multipart upload
//
// FileUploader.swift
//
// Copyright (c) 2015 Narciso Cerezo Jiménez. All rights reserved.
// Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829//
import Foundation
import Alamofire
private struct FileUploadInfo {
@macu
macu / timeout.swift
Last active February 22, 2022 08:03
Timeout utility in Swift, with the ability to cancel a deferred callback.
import Foundation
/// Timeout wrapps a callback deferral that may be cancelled.
///
/// Usage:
/// Timeout(1.0) { println("1 second has passed.") }
///
class Timeout: NSObject
{
private var timer: NSTimer?
@nickbabcock
nickbabcock / graphite.conf
Last active December 6, 2019 06:18
Installs Graphite on CentOS 6
server {
listen 80;
root /opt/graphite/webapp/content;
location / {
# checks for static file, if not found proxy to app
try_files \$uri @app;
}
location @app {
@isao
isao / TypeScript.plist
Last active November 30, 2023 11:59 — forked from davethesoftwaredev/TypeScript.plist
BBEdit Codeless Language Module for TypeScript syntax coloring and class/interface/function folding.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- https://gist.github.com/isao/5f6fbe89a438086c36d8
BBEdit Language Module for TypeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Forked from
@jasonwiener
jasonwiener / hello world come on in the water's fine
Last active January 2, 2016 00:29
this is the description of the gist
<html>
<head>
<title>test</title></head>
<body>
<center>hello world</center>
</body>
</html>
@GregMefford
GregMefford / setup-statsd-centos.sh
Last active April 10, 2022 15:31 — forked from collegeman/setup-statsd.sh
Install Graphite and StatsD on CentOS (updated for 6.4 x86_64)
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached