Skip to content

Instantly share code, notes, and snippets.

@lopspower
lopspower / README.md
Last active May 18, 2024 12:14
All Android Directory Path

All Android Directory Path

Twitter

1) System directories

⚠️ We can't write to these folers

Method Result
@jmindek
jmindek / gist:62c50dd766556b7b16d6
Last active January 31, 2024 15:48
DISTINCT ON like functionality for Redshift

distinct column -> For each row returned, return only the unique members of a set. Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.

test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
-----------+------------+-----------------------------
1000040 | 103 | 1000040|2645405726|0001|103
@dkandalov
dkandalov / jira.groovy
Last active October 7, 2022 03:56
Tiny example of using JIRA rest API from groovy
/**
* You might need to import JIRA ssl certificate into your jdk/jre cacerts file:
* 1) save JIRA certificate. E.g. in Chrome right click on https icon, click "Certificate information" link.
* In "Details" tab, click "Copy to File..." button.
* 2) in jdk "bin" folder run: "keytool -importcert -keystore ./cacerts -file /file/from/the/step/above/cacert.crt -trustcacerts -alias jira_ca
*/
class JiraMain {
static void main(String[] args) {
// see https://docs.atlassian.com/jira/REST/latest/
def listWatchers = "https://jira/rest/api/2/issue/PROJ-123/watchers"
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@dpogorzelski
dpogorzelski / directives.js
Created August 27, 2013 08:16
Twitter share button as AngularJS directive.
directives.directive('twitter', [
function() {
return {
link: function(scope, element, attr) {
setTimeout(function() {
twttr.widgets.createShareButton(
attr.url,
element[0],
function(el) {}, {
count: 'none',
@willurd
willurd / web-servers.md
Last active July 12, 2024 11:21
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jpertino
jpertino / cliBuilderExample.groovy
Created December 30, 2010 14:32
groovy CliBuilder usage
def cli = new CliBuilder().with {
usage = 'program [options] <arguments>'
header = 'Options:'
footer = '-' * width
s 'simplest boolean option'
b longOpt: 'both', 'boolean option with both longop and shortop'
_ longOpt: 'no-shortop-1', 'boolean option without short version 1'