Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/env python | |
"""mergelog | |
This is a custom merge driver for git. It should be called from git | |
with a stanza in .git.config like this: | |
[merge "mergelog"] | |
name = A custom merge driver for my log.txt file. | |
driver = ~/scripts/mergelog %O %A %B %L | |
recursive = binary |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/* Base fragment to ensure the parent activity implements a contract interface. */ | |
public abstract class ContractFragment<T> extends Fragment { | |
private T mContract; | |
@Override | |
public void onAttach(Activity activity) { | |
try { | |
mContract = (T)activity; | |
} catch (ClassCastException e) { | |
throw new IllegalStateException(activity.getClass().getSimpleName() |
package pntanasis.master_ex.android; | |
import pntanasis.master_ex.android.Synthesizer.Note0; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class AudioSynthesisDemoActivity extends Activity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
package fruit; | |
import java.io.IOException; | |
import java.net.URL; | |
import javafx.application.Application; | |
import javafx.fxml.FXMLLoader; | |
import javafx.scene.Scene; | |
import javafx.scene.image.Image; | |
import javafx.scene.layout.AnchorPane; | |
import javafx.stage.Stage; |
import android.support.v4.app.Fragment; | |
public class FragmentUtils { | |
/** | |
* @param fragment | |
* The Fragment whose parent is to be found | |
* @param parentClass | |
* The interface that the parent should implement | |
* @return The parent of fragment that implements parentClass, |
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
package com.cyrilmottier.android.resourcesadditions; | |
import android.content.res.Resources; | |
import android.content.res.XmlResourceParser; | |
import android.os.Bundle; | |
import org.xmlpull.v1.XmlPullParser; | |
import org.xmlpull.v1.XmlPullParserException; | |
/** | |
* @author Cyril Mottier |
# copy from local machine to remote machine | |
scp localfile user@host:/path/to/whereyouwant/thefile | |
# copy from remote machine to local machine | |
scp user@host:/path/to/remotefile localfile |
/* | |
* Copyright (C) 2006 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |