Skip to content

Instantly share code, notes, and snippets.

<?php
class CalendarEvent {
/**
*
* The event ID
* @var string
*/
private $uid;
@theUncanny
theUncanny / uninstall.sh
Created May 18, 2018 09:53 — forked from myusuf3/uninstall.sh
how to cleanly uninstall python packages installed with python setup.py
# Next time you need to install something with python setup.py -- which should be never but things happen.
python setup.py install --record files.txt
# This will cause all the installed files to be printed to that directory.
# Then when you want to uninstall it simply run; be careful with the 'sudo'
cat files.txt | xargs sudo rm -rf
@theUncanny
theUncanny / gistColaboration.md
Created April 27, 2018 10:22 — forked from maglietti/gistColaboration.md
How to collaborate on a gist

To colaborate on a gist:

  1. Clone your gist repo locally
  2. Add your friend’s fork as a remote e.g. if your friend is named Cindy: git remote add-url cindy https://gist.github.com/cindy/df03bdacaef75a80f310
  3. Fetch your friend’s commits: git fetch cindy/master
  4. Merge your friend’s changes into your repo: git merge cindy/master
  5. Push the changes back to GitHub: git push origin/master
@theUncanny
theUncanny / go-os-arch.md
Created February 25, 2018 22:16 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@theUncanny
theUncanny / playlist.sh
Created February 15, 2018 13:59 — forked from scarlson/playlist.sh
Bash script to create .m3u playlist files for all mp3s in subdirectories
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson ([email protected])
find . -type d |
while read subdir
do
rm -f "$subdir"/*.m3u
@theUncanny
theUncanny / gitflow-breakdown.md
Created December 11, 2017 16:05 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@theUncanny
theUncanny / akamai-curl.sh
Created October 18, 2017 14:54 — forked from jsleeio/akamai-curl.sh
curl wrapper for Akamai debugging
#!/bin/sh
usage() {
echo "usage: $0 [-s] [-v] [-L] [-h HTTPHOST] [-X HTTPMETHOD] URL"
exit 1
}
args=`getopt svLX:h: $*`
if [ $? != 0 ] ; then
usage
@theUncanny
theUncanny / sample-linux.c
Created July 18, 2017 21:59 — forked from davidzchen/sample-linux.c
Sample C code using the Linux kernel coding style
/*
* Sample file using the Linux kernel coding convention.
*
* https://www.kernel.org/doc/Documentation/CodingStyle
*
* General rules:
* - Indents are tabs and must be 8 spaces wide.
* - Each line must be at most 80 characters long.
* - Use C-style comments.
* - File names should be lower-case.c
@theUncanny
theUncanny / Xml.php
Created April 4, 2017 21:49 — forked from barryvdh/Xml.php
XML Helper (from/to array)
<?php
use SimpleXMLElement;
class Xml {
/**
* @param array $data
* @param string $root
* @return SimpleXMLElement
<?php
class Csv
{
public static function fromArray($rows, $delimiter = ',')
{
if (empty($rows)) {
return '';
}