Skip to content

Instantly share code, notes, and snippets.

Javier Santos javiersantos

View GitHub Profile
@javiersantos
javiersantos / button_circular.xml
Last active Aug 29, 2015
A circular button for Android. Apply the layout using android:background="@drawable/button_circular".
View button_circular.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<solid
android:width="3dp"
android:color="@android:color/white" />
@javiersantos
javiersantos / redmine_hash_password.php
Created Jul 21, 2015
Create Redmine User Password
View redmine_hash_password.php
<?php
$plain_password = 'password';
$user_salt = '';
$hash = sha1('#' . $user_salt . '#' . sha1($plain_password));
echo $hash . "\n";
?>
@javiersantos
javiersantos / currentChromeTab.js
Last active May 4, 2020
Get the current URL of the selected Chrome tab. Useful for Chrome/Chromium extensions.
View currentChromeTab.js
/*
* Get the current URL of the selected Chrome tab. Call to getCurrent
* By Javier Santos
* https://gist.github.com/javiersantos/c3e9ae2adba72e898f99
*/
var currentURL;
chrome.tabs.query({'active': true, 'windowId': chrome.windows.WINDOW_ID_CURRENT},
function(tabs){
@javiersantos
javiersantos / Uppercase.java
Last active Aug 29, 2015
Return the uppercase letters of a string
View Uppercase.java
/*
* Return the uppercase letters of a string. Useful to return an acronym.
* By Javier Santos
* https://gist.github.com/javiersantos/58b7aa21338082d6c850
*/
public String getUppercase(String str) {
String res = "";
String[] split = str.split(" ");
@javiersantos
javiersantos / check-apc-module.php
Last active Aug 29, 2015
Check if a specific PHP module is installed
View check-apc-module.php
<?php
/*
* Check if APC Module is installed
* By Javier Santos
* https://gist.github.com/javiersantos/575929cc9985d0195fc0
*/
if (extension_loaded('apc')) {
echo "true";
@javiersantos
javiersantos / telegram-installer.sh
Last active Jan 3, 2020 — forked from jalcaldea/telegram-installer.sh
Install Telegram for Deskop (Linux)
View telegram-installer.sh
#!/bin/bash
echo "============================================="
echo "== Telegram Script Installer v 0.1 =="
echo "== =="
echo "== by Jalcaldea =="
echo "============================================="
echo "Downloading necesary files..."
You can’t perform that action at this time.