Skip to content

Instantly share code, notes, and snippets.

View gabrielribeiro's full-sized avatar

Gabriel Ribeiro gabrielribeiro

View GitHub Profile
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
@gabrielribeiro
gabrielribeiro / EmptyTrash.command
Created August 22, 2014 18:57
Empty Trash Mac
#!/bin/bash
#this is a comment-the first line sets bash as the shell script
rm -rf ~/.Trash/*
exit 0
--'sp_rename ''' + obj.name + ''', ''FK_' + tab1.name + '_' + tab2.name + '_' + col2.name + '''',
SELECT
'sp_rename ''' + obj.name + ''', ''FK_' + tab1.name + '_' + tab2.name + '_' + col2.name + '''' AS [PROC],
'FK_' + tab1.name + '_' + tab2.name + '_' + col2.name + '''' AS EXPECTED_NAME,
obj.name AS FK_NAME,
tab1.name AS [table],
tab2.name AS [referenced_table],
col2.name AS [referenced_column]
FROM sys.foreign_key_columns fkc
INNER JOIN sys.objects obj
SELECT
'sp_rename ''' + OBJECT_NAME(OBJECT_ID) + ''', ''PK_' + OBJECT_NAME(parent_object_id) + '''' AS [PROC],
OBJECT_NAME(OBJECT_ID) AS NameofConstraint,
OBJECT_NAME(parent_object_id) AS TableName,
type_desc AS ConstraintType
FROM sys.objects
WHERE type_desc LIKE 'PRIMARY_KEY_CONSTRAINT' AND OBJECT_NAME(parent_object_id) <> 'sysdiagrams'
AND OBJECT_NAME(OBJECT_ID) <> 'PK_' + OBJECT_NAME(parent_object_id)
@gabrielribeiro
gabrielribeiro / phantomjs-linkedin.js
Last active July 30, 2017 22:04 — forked from pasiaj/phantomjs-linkedin.js
A phantomjs script to:a) Login to Linkedin.comb) Scrape all your contactsc) Visit all the contactsd) Automatically endorse all contacts' skills.
var auth = {
user: "USERNAME",
pass: "PASSWORD"
};
function ParallelRunner (list, func, runners) {
function createSlots(runners) {
var slots = [];
for (var i = 0; i < runners; i++) {
slots.push( objReturner() );
@gabrielribeiro
gabrielribeiro / iOS Usage Descriptions.plist
Created March 22, 2019 18:01
Values for usage descriptions to put in info.plist
<dict>
<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME) calendar events</string>
<key>NSRemindersUsageDescription</key>
<string>$(PRODUCT_NAME) reminder use</string>
<key>NSCameraUsageDescription</key>
<string>This app requires to access your photo library to show image on profile and send via chat</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires to access your microphone to record video with your voice send via chat</string>
<key>NSPhotoLibraryUsageDescription</key>