Skip to content

Instantly share code, notes, and snippets.

View ragar90's full-sized avatar
💪
grinding the code

René Alfredo García Hernández ragar90

💪
grinding the code
View GitHub Profile
@ragar90
ragar90 / git_branch.sh
Last active October 23, 2023 19:29
Display your current branch on your terminal
# Steps to install it
# 1. Open .bashrc with nano ~/.bashrc
# 2. Scroll to the bottom of the file
# 3. Copy and paste the code below
# 4. Reload your terminal just by closing it and reopen it or by calling source ~/.bashrc
# 5. Move to any git repo and ensure you have a prompt like the following dev0@dev0-Precision-7770 learning-hub (staging)$
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
@ragar90
ragar90 / README.md
Created February 13, 2023 21:28 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

04-05 17:25:45.202 1862-1864/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
04-05 17:25:45.202 1862-1864/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
04-05 17:25:45.218 862-2100/? E/ActivityManager: applyOptionsLocked: Unknown animationType=0
04-05 17:25:45.741 14574-14601/? E/ReactNativeJS: No dimension set for key window
04-05 17:25:45.745 14574-14601/? E/ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)
04-05 17:25:45.750 14574-14602/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: org.givesafe.merchant, PID: 14574
com.facebook.react.common.JavascriptException: No dimension set for key window, stack:
value@77:706
value@76:228
@ragar90
ragar90 / json
Last active November 20, 2017 17:50
{
aps: {
alert: data,
sound: true,
badge: 0
},
data: data
}
@ragar90
ragar90 / gradle.log
Created April 3, 2017 17:14
grade exception log
Error:org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException: Could not parse POM https://oss.sonatype.org/content/repositories/snapshots/com/braintreepayments/api/braintree/2.5.3-SNAPSHOT/braintree-2.5.3-20170329.161535-1.pom
Error:java.lang.RuntimeException: Missing required attribute: dependency groupId
Error:org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException: Could not parse POM https://oss.sonatype.org/content/repositories/snapshots/com/braintreepayments/api/braintree/2.5.3-SNAPSHOT/braintree-2.5.3-20170329.161535-1.pom
Error:java.lang.RuntimeException: Missing required attribute: dependency groupId
Error:org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException: Could not parse POM https://oss.sonatype.org/content/repositories/snapshots/com/braintreepayments/api/braintree/2.5.3-SNAPSHOT/braintree-2.5.3-20170329.161535-1.pom
Error:java.lang.RuntimeException: Missing required attribute: dependency groupId
Error:o
@ragar90
ragar90 / gist:b1b4f9b917126035a4b1ea3b9f7f229d
Created January 2, 2017 06:57 — forked from jjb/gist:996292
How to securely acquire the Mozilla root certificate bundle for use with curl, Net::HTTP, etc.

If you want to use curl or net-http/open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.

You can manually install the root certs, but first you have to get them from somewhere. This article gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.

problem: Sadly, ironically, and comically, it's not possible to access that file via https! Luckily, the awesome curl project does provide us with the script that they use to produce the file, so we can do it securely ourselves. Here's how.

  1. git clone https://github.com/bagder/curl.git
  2. cd curl/lib
  3. edit mk-ca-bundle.pl and change:
@ragar90
ragar90 / merge.sh
Last active July 27, 2016 20:42
Merge only changes from branch B into current branch A
# After merging master into this branch, let's use the files from master and ignore our conflicts
git checkout --theirs some/file/in/my/repo/with/conflicts
# Now let's add those files into the commit
git add .
# This should result in something like this when running 'git status'
# On branch blah
# Your branch is up-to-date with 'origin/blah'.
# All conflicts fixed but you are still merging.
# (use "git commit" to conclude merge)
# Changes to be committed:
@ragar90
ragar90 / gist:641f00dd5193d1f9fa41
Created February 22, 2015 23:07
doorman_socket_edison
var socket = require('socket.io-client')('http://192.168.129.194:9000');
var fs = require("fs");
socket.on('connect', function(){
console.log('Connected!');
//*******
//TODO: User fedex guy picture
var image_origial = "back_to_the_future.jpg";
fs.readFile(image_origial, "base64", function(err,data){
if(err){
console.log(err);
function _cancelQueuedTasks(configs, tasks, callback){
var worker = new ironworker.Client({token: config.IRON_WORKER_TOKEN, project_id: config.IRON_WORKER_PROJECT_ID});
newerTasks = tasks.slice(2, tasks.length);
log(newerTasks.length + " newerTasks are going to be deleted")
async.eachSeries(newerTasks, function(task, cb){
log("Canceling task: " + task.id + " [RMCaseJobScheduler]")
worker.tasksCancel(task.id,function(error, results){
log("=======Results======")
log(JSON.stringify(results))
log("======Errors========")