Skip to content

Instantly share code, notes, and snippets.

View Telematica's full-sized avatar

Héctor Cerón Figueroa Telematica

View GitHub Profile
@Telematica
Telematica / twitterListMigration.js
Created August 15, 2016 00:08
Get User from Twitter List and Request List Migrate (Twitter for Web)
//[\r\n]+
var users = [],
listId = JSON.parse(document.getElementById('init-data').value).list_id, //'762404565366956032',
headers = {
"Accept" : "application/json, text/javascript, */*; q=0.01",
"Accept-Language" : "en-US,en;q=0.5",
"Content-Type" : "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With" : "XMLHttpRequest",
},
formData = {
@Telematica
Telematica / Bitso.js
Last active August 15, 2016 00:16
Bitso Web Desktop Notifications
;(function(window) {
Notification
.requestPermission()
.then(function(result) {
if ('granted' === result) {
openIframe();
window.timer = setInterval(
function() {
var change = '',
operator = '',
@Telematica
Telematica / HITSSHost.js
Last active August 20, 2016 03:02
HITSS Host Hours AutoSubmission
//;(function(window, $, datos) {
/**
*
* @ToDo Find calendar days
*
*/
var activities =[
{ 'Id_Actividad' : 380814, 'horas' : 2 }, //ANALISIS
{ 'Id_Actividad' : 380812, 'horas' : 6 } //DESARROLLO
@Telematica
Telematica / JSRegex.js
Last active December 19, 2016 22:47
JS Regex Sample Collection
;(function(){
console.log(
/^([a-zA-Z]{3,4})-(\d{6})-((\D|\d){3})?$/.test('OIHG-551205-2L7'), //Check RFC Format
/[\r\n]+/.test('ABCD\n \t EFGHI\n \t ') //Select Line,
/(?=.*?\bbundle\b)(?=.*?\bstandalone\b)^.*$/i.test('standalone bundle'), //
/(?=.*?\bbundle\b)(?=.*?\bstandalone\b)^.*$/i.test('standalone? bundle'), //
/(?=.*?\bbundle\b)(?=.*?\bstandalone\b)^.*$/i.test('standalone_ bundle'), //
'/^[a-f0-9]{32}$/'.test('5d41402abc4b2a76b9719d911017c592'), // MD5 check
/cmb[\d\w-_]+/.test('cmbCountry'), //
' _ A + B _ '.replace(/^\s+|\s+$/g, ""), // Emulates trim()
@Telematica
Telematica / repos.json
Last active December 11, 2017 19:54
JSON DB from handy/useful Github Repos, Info & Docs
{
".gitignore" : "https://github.com/github/gitignore/blob/master/Symfony.gitignore",
"gitbook" : "https://github.com/GitbookIO/gitbook",
"HBP Apache Settings": "https://github.com/h5bp/server-configs-apache"
}
@Telematica
Telematica / git.md
Last active September 19, 2024 00:36
Git Recipes
@Telematica
Telematica / SublimeTextTricks.txt
Created September 21, 2016 21:09
Sublime Text Handy Tricks
#REGEX REPLACE
find : <li>*.+?(echo)+.*<\/li>
replace : <?php if($userac->hasPermission('access','')) { ?>\n\t\t$0\n\t\t\t<?php } ?>
#http://stackoverflow.com/questions/20742076/regex-replace-uppercase-with-lowercase-letters
#Lowercase Replacement
find : \bAS\b
replace : \L$0
#Uppercase Replacement
@Telematica
Telematica / config
Last active June 28, 2017 01:17
SSH Tricks and Handful commands
##http://www.howtogeek.com/howto/linux/keep-your-linux-ssh-session-from-disconnecting/
#Global Configuration
#Add the following line to the /etc/ssh/ssh_config file:
ServerAliveInterval 60
#The number is the amount of seconds before the server with send the no-op code.
#Current User Configuration
#Add the following lines to the ~/.ssh/config file (create if it doesn’t exist)
Host *
@Telematica
Telematica / doctrineCmd.md
Last active June 10, 2018 22:54
Doctrine Console Commands

Doctrine Console Commands

Convert Mapping

php vendor/bin/doctrine orm:convert-mapping --force --from-database --from-database xml test/Mapping
php vendor/bin/doctrine orm:convert-mapping --force --from-database --from-database xml module/Application/src/Entity/

Generate Annotation Mapping directly from DB (Inverse Engineering)

@Telematica
Telematica / diff.py
Created February 20, 2017 02:51
Git external Diff Tool (Python script)
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
#git config -l
#diff.external=/path/to/script/diff.py