Skip to content

Instantly share code, notes, and snippets.

View djalmajr's full-sized avatar

Djalma Júnior djalmajr

View GitHub Profile
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
@djalmajr
djalmajr / README.md
Created September 30, 2017 18:22 — forked from lokothodida/README.md
Small bookmarklet to help change app drawer icons for Chrome OS web apps
  • Create a bookmark with the following text in the URL field:
javascript:(function() {
  var links = document.querySelectorAll('link[rel*=icon]');
  var href  = prompt('Enter your new shelf icon\'s URL');
  href && links.forEach((link) => link.href = href);
})();
@djalmajr
djalmajr / wall-variation.java
Created September 14, 2017 20:32
RoboCode Robot Wall Variation
package ifal;
import robocode.*;
import java.awt.Color;
import static robocode.util.Utils.normalRelativeAngleDegrees;
// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html
/**
* RedRibbon - Robô feito por Djalma e Nywton
@djalmajr
djalmajr / template.js
Created July 5, 2017 16:45 — forked from katspaugh/template.js
String.prototype.template
String.prototype.template = function (obj) {
return this.replace(
/{{(.+?)}}/g,
function (_, key) { return obj[key] }
)
}
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0
, isIE = /*@cc_on!@*/false || !!document.documentMode
, isChrome = !!window.chrome && !!window.chrome.webstore;
window.__BrowserDetection = {
// Opera 8.0+
isOpera: isOpera,
// Firefox 1.0+
isFirefox: typeof InstallTrigger !== "undefined",
// At least Safari 3+: "[object HTMLElementConstructor]"
@djalmajr
djalmajr / genymotionwithplay.txt
Created May 24, 2016 20:48 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@djalmajr
djalmajr / Main.java
Created May 21, 2016 13:24 — forked from joao-felipe-goncalves/Main.java
SQL para registro de todos os estados e cidades do Brasil
package jfrode.jsontosql.main;
import java.io.BufferedReader;
import java.io.FileReader;
import org.json.JSONArray;
import org.json.JSONObject;
/**
*
@djalmajr
djalmajr / estados-cidades.json
Created May 21, 2016 13:22 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@djalmajr
djalmajr / getElementsByAttr.js
Created May 17, 2016 22:33
getElementsByAttr
function getElementsByAttr(attribute, value, parent) {
var matchingElements = [],
allElements = (parent || document).getElementsByTagName("*");
for (var i = 0, n = allElements.length; i < n; i++) {
if (allElements[i].getAttribute(attribute) === value) {
// Element exists with attribute. Add to array.
matchingElements.push(allElements[i]);
}
}
Array(numParcelas).join(1).split("").map(n => ...)
Array.apply(null, Array(numParcelas)).map(n => ...)
Array(...Array(numParcelas)).map(n => ...)