This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
import os | |
import tarfile | |
import shutil | |
import glob | |
from datetime import datetime | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActionProvider extends ActionProvider { | |
private Context mContext; | |
public MyActionProvider(Context context) { | |
super(context); | |
mContext = context; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Immediately Invoked Function Expression (IIFE) | |
(function() { | |
'use strict'; | |
angular | |
.module('app') | |
.directive('datepickerMask', datepickerMask); | |
function datepickerMask() { | |
var directive = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from line_profiler import LineProfiler | |
def do_profile(follow=[]): | |
def inner(func): | |
def profiled_func(*args, **kwargs): | |
try: | |
profiler = LineProfiler() | |
profiler.add_function(func) | |
for f in follow: | |
profiler.add_function(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myenvs() { | |
if [[ $# -ne 1 ]]; then | |
export $(cat .env | xargs) | |
else | |
export $(cat $1 | xargs) | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell "run-as com.example chmod 666 databases/db.name" | |
adb pull /data/data/com.example/databases/db.name . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exercise to hire new front-end in the future | |
You have a list of string (var regions = ['Brazil', 'SP', 'São Carlos', 'Caaso'] | |
Each one of these strings represents a region, the first region is the parent (includes) the second region, and so on. | |
You have the following POST route /region, that accepts name and parentId, and return the ID of the region created | |
Write a program in **JS** that saves all the regions taking into consideration their hierarchy: | |
Example of algorithm: | |
Save Brasil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface Person : NSObject <RCTBridgeModule> | |
@end | |
@implementation Logger | |
RCT_EXPORT_MODULE() | |
RCT_EXPORT_METHOD(greet:(NSString *)name) | |
{ | |
NSLog(@"Hi, %@!", name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
co = checkout | |
ec = config --global -e | |
cob = checkout -b | |
cm = !git add -A && git commit -m | |
st = status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find and update all import React, { Component } from 'react-native' | |
root | |
.find(j.ImportDeclaration, { | |
source: { | |
value: 'react-native' | |
} | |
}) | |
.filter(({node}) => { | |
// check React or { Component } from 'react-native' | |
const nodes = node.specifiers.filter(imports => { |
OlderNewer