Skip to content

Instantly share code, notes, and snippets.

@pronebird
pronebird / github-commit-url.sh
Created September 6, 2016 13:23
Custom action for Source Tree app to copy commit URL on GitHub
#!/bin/sh
#
# Custom action for Source Tree app to copy commit URL on GitHub
# Menu caption: Copy Changeset URL on GitHub
# Script to run: ~/bin/github-commit-url
# Parameters: $REPO $SHA
#
if (( $# != 2 ))
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active June 30, 2023 09:45
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@lsloan
lsloan / BetterEnum.php
Last active April 12, 2024 01:02
BetterEnum.php: A pure-PHP alternative to SplEnum, although only a 99% compatible replacement for it.
<?php
/**
* Class BetterEnum
*
* A pure-PHP alternative to SplEnum, although only a 99% compatible replacement for it.
*
* See: http://php.net/manual/en/class.splenum.php
*
* To declare an enum class, subclass BetterEnum and define the names and values as constants.
@imjoshholloway
imjoshholloway / app.js
Last active July 8, 2016 15:36
ngPluralize but with support for HTML
angular.module('myApp', ['ngPluralizeHtml'])
function AppController() {
var vm = this;
vm.count = 10;
}
.controller('AppController', AppController);
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 16, 2024 16:36
`git flow` vs. `git`: 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

@libinbensin
libinbensin / MainActivity.java
Last active December 9, 2023 14:44
Facebook Popup using PopupWindow
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@stojg
stojg / parse-xml.php
Last active November 18, 2022 21:31
Parsing a huge XML with closure in PHP
<?php
// An example on how to parse massive XML files with PHP by chunking it up to avoid running out of memory
// Open the XML
$handle = fopen('file.xml', 'r');
// Get the nodestring incrementally from the xml file by defining a callback
// In this case using a anon function.
nodeStringFromXMLFile($handle, '<item>', '</item>', function($nodeText){
// Transform the XMLString into an array and