Skip to content

Instantly share code, notes, and snippets.

@pronebird
pronebird / github-commit-url.sh
Created Sep 6, 2016
Custom action for Source Tree app to copy commit URL on GitHub
View github-commit-url.sh
#!/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 Apr 26, 2021
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

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 Jun 25, 2018
BetterEnum.php: A pure-PHP alternative to SplEnum, although only a 99% compatible replacement for it.
View BetterEnum.php
<?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 Jul 8, 2016
ngPluralize but with support for HTML
View app.js
angular.module('myApp', ['ngPluralizeHtml'])
function AppController() {
var vm = this;
vm.count = 10;
}
.controller('AppController', AppController);
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 6, 2021
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

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 Oct 14, 2020
Facebook Popup using PopupWindow
View MainActivity.java
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@stojg
stojg / parse-xml.php
Last active Mar 4, 2021
Parsing a huge XML with closure in PHP
View parse-xml.php
<?php
// 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
print_r(getArrayFromXMLString($nodeText));