Skip to content

Instantly share code, notes, and snippets.

View radoslawbialek's full-sized avatar

Radosław Białek radoslawbialek

View GitHub Profile
@udacityandroid
udacityandroid / StoreContract.java
Created July 26, 2016 22:13
Example contract class for a table which contains data about the store's headphones stock
public final class StoreContract {
public static abstract class HeadphoneEntry implements BaseColumns {
public static final String TABLE_NAME = "headphones";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_PRICE = "price";
public static final String COLUMN_STYLE = "style";
public static final String COLUMN_IN_STOCK = "in_stock";
public static final String COLUMN_DESCRIPTION = "description";
@udacityandroid
udacityandroid / WeatherContract.java
Created July 26, 2016 21:54
Contract class for a weather application called Sunshine
/*
* Copyright (C) 2014 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
@gfscott
gfscott / getJson.js
Created June 17, 2016 19:59
A simple, reusable AJAX helper function for GETting JSON
// -----------------------------------------------------------------------------
// SIMPLE REUSABLE AJAX GET JSON FUNCTION
// A frequent thing I find myself writing in projects is a simple function to
// get JSON via AJAX. This simple helper does that in a sensible way without
// needing jQuery or a needlessly complex standalone Ajax library. Get data
// so you can do stuff with it. That’s all it does. No POSTing, no crazy edge-
// case error handling.
function getJson(url, callback) {
@PurpleBooth
PurpleBooth / README-Template.md
Last active September 22, 2024 04:13
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active September 6, 2024 15:34
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@noamraph
noamraph / byzanz_window.py
Created January 10, 2014 08:24
byzanz_window: Use byzanz to create a GIF screencast of a specific window
#!/usr/bin/env python
"""
Use byzanz to create a GIF screencast of a specific window.
Required tools:
sudo apt-get install byzanz x11-utils xdotool
A tip: use an extra-long duration (-d 100), record your shot, and use
gimp to shorten the duration of the last frame. You need to rename the layer
from "Frame 123 (100000 ms) (combine)" to "Frame 123 (1000 ms) (combine)".
@lyoshenka
lyoshenka / search-git-history.md
Last active July 23, 2024 21:24
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@Udinic
Udinic / TasksContract.java
Last active October 12, 2018 15:34
A contract class to work with Any.do's Content Provider. A full guide is available at http://tech.any.do/content-provider-for-any-do/
/**
* This class provides the URI and const values to work with Any.do's Content Provider.
*
* A guide is available on http://tech.any.do/content-provider-for-any-do/
*/
public class TasksContract {
public static final Uri TASKS_URI = Uri.parse("content://com.anydo.provider/tasks");
public static final Uri FOLDERS_URI = Uri.parse("content://com.anydo.provider/folders");
public static final String PERMISSION_READ = "com.anydo.provider.permission.READ_ANYDO_TASKS";