Skip to content

Instantly share code, notes, and snippets.

@lavalake
lavalake / gist:d83a5bc14284161433019475013996d1
Created October 14, 2017 01:54 — forked from tsohr/gist:5711945
Android activity manager "am" command help
adb shell am
usage: am [subcommand] [options]
usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]
[--R COUNT] [-S] [--opengl-trace] <INTENT>
am startservice <INTENT>
am force-stop <PACKAGE>
am kill <PACKAGE>
am kill-all
am broadcast <INTENT>
am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@DallasO
DallasO / .bash_aliases
Last active April 14, 2023 23:38
My Bash aliases
## BASIC
alias x='exit'
alias c='clear'
alias ll='ls -lh' # List files/dirs, `-l` with more details, `-h` show filesize in human-readable format
alias grep='grep --color=auto' # COLORSS!
## Routine
alias update='sudo apt update && apt list --upgradeable' # Check for updates
alias upgrade='sudo apt upgrade --auto-remove' # Install those updates
alias autoremove='sudo apt autoremove && sudo apt autoclean' # Run every few months to clear apt cache
alias aptinstall='sudo apt install' # Install something from apt
@TomTasche
TomTasche / nginx.conf
Last active January 27, 2023 21:22
config for nginx to proxy a specific path to an S3 bucket
# copied from default config
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@drmalex07
drmalex07 / drupal-entityfieldquery-example-1.php
Last active January 6, 2023 17:12
An example of an EntityFieldQuery in drupal 7. #drupal #php #drupal-entities
<pre><?php
////////////////////////////////////////////////////
// See more at https://drupal.org/node/1343708 //
////////////////////////////////////////////////////
//
// Filter entities based on several {entity,property,field}-based criteria
//
@Antarix
Antarix / LocalBroadcastExampleActivity.java
Created December 26, 2013 08:31
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@HakanL
HakanL / HighPrecisionTimer
Created January 30, 2013 00:34
C# code for a High Precision Timer (avg <1 ms for 25 ms interval). Fair use of CPU time. Uses NLog to log accuracy
using NLog;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Animatroller.Framework.Utility
{
public class HighPrecisionTimer : IDisposable
{
@Hades32
Hades32 / elixir-npp.xml
Created October 14, 2014 18:46
Simple syntax highlighting for Elixir for Notepad++
<NotepadPlus>
<UserLang name="Elixir" ext="ex exs" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00# 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@tsupo
tsupo / convIsbn.js
Created May 8, 2009 18:43
covert code between ISBN10 and ISBN13
/* convISBN.js : converter ISBN10 <-> ISBN13 */
/* Copyright (c) 2007 by H.Tsujimura <tsupo@na.rim.or.jp> */
/* Distributed by LGPL. */
/* this script written by H.Tsujimura 20 Jan 2007 */
function convISBN13toISBN10(str) {
var s;
var c;
var checkDigit = 0;
var result = "";
@piekie
piekie / RootUtils.java
Last active July 30, 2021 08:09
Utils : Kill and Force-Stop functions for android app.
public class RootUtils {
private static Process su;
public static void gainRoot() {
try {
su = Runtime.getRuntime().exec("su");
} catch (IOException e) {
e.printStackTrace();
}