Skip to content

Instantly share code, notes, and snippets.

Working from home

Christopher Prince crspybits

Working from home
View GitHub Profile
ticean /
Created May 10, 2011
Shell script to drop all tables from MySQL.
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
View states_hash.json
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
dearaujoj / remove_git_tag
Created Oct 22, 2013
git remove tag locally and remote
View remove_git_tag
git tag -d TagName && git push origin :refs/tags/TagName
mobilemind /
Last active Mar 3, 2021
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
cecilemuller /
Last active Feb 26, 2021
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)

Virtual hosts

Let's say you want to host domains and

Create folders for their files:

danielgalasko / RepeatingTimer.swift
Last active Jan 18, 2021
A repeating GCD timer that can run on a background queue
View RepeatingTimer.swift
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents
/// crashes that occur from calling resume multiple times on a timer that is
/// already resumed (noted by
class RepeatingTimer {
let timeInterval: TimeInterval
init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
hishma / CLLocation+Encodable.swift
Created Jan 16, 2019
CoreLocation and Codable
View CLLocation+Encodable.swift
extension CLLocation: Encodable {
public enum CodingKeys: String, CodingKey {
case latitude
case longitude
case altitude
case horizontalAccuracy
case verticalAccuracy
case speed
case course
case timestamp