This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=CONCATENATE("INSERT INTO wp_3_terms (name, slug) values ('",C2,"', '",E2,"');"," | |
SET @LASTID = LAST_INSERT_ID();"," | |
INSERT INTO wp_3_term_taxonomy (term_id, taxonomy,parent,count) VALUES(@LASTID, 'media_source', 0,0);", | |
"INSERT INTO wp_3_pods_media_source (@LASTID, ",A2,");") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=LOWER(CLEAN(SUBSTITUTE(TRIM(C2)," ","-"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function sanitize_title_with_dashes(title As String) As String | |
Dim oDoc As HTMLDocument | |
Set oDoc = New HTMLDocument | |
oDoc.body.innerHTML = title | |
title = oDoc.body.innerText | |
title = LCase(title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS `slugify`; | |
DELIMITER ;; | |
CREATE DEFINER=`root`@`localhost` | |
FUNCTION `slugify`(dirty_string varchar(200)) | |
RETURNS varchar(200) CHARSET latin1 | |
DETERMINISTIC | |
BEGIN | |
DECLARE x, y , z Int; | |
Declare temp_string, new_string VarChar(200); | |
Declare is_allowed Bool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$raven = array( | |
"Once upon a midnight dreary, while I pondered, weak and weary,", | |
"Over many a quaint and curious volume of forgotten lore-", | |
" While I nodded, nearly napping, suddenly there came a tapping,", | |
"As of some one gently rapping, rapping at my chamber door.", | |
"\"'Tis some visitor,\" I muttered, \"tapping at my chamber door-", | |
" Only this and nothing more.\"", | |
"", | |
" Ah, distinctly I remember it was in the bleak December;", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE DEFINER=`root`@`%` PROCEDURE `new_procedure`() | |
BEGIN | |
DECLARE counter int; | |
set counter = 0; | |
while counter < 1000000 do | |
insert into Rating (Rating, MovieID) VALUES (truncate(rand()*10, 0), 1); | |
set counter=counter+1; | |
end while; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `movies` ( | |
`ID` int(11) NOT NULL AUTO_INCREMENT, | |
`MovieName` varchar(45) DEFAULT NULL, | |
`Rating` double DEFAULT NULL, | |
`DateAdded` timestamp NULL DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`ID`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; | |
CREATE TABLE `Rating` ( | |
`ID` int(11) NOT NULL AUTO_INCREMENT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet. | |
* - Main function 1: List all folders | |
* - Main function 2: List all files & folders | |
* | |
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field. | |
* The folder ID is everything after the 'folders/' portion of the URL. | |
* | |
* @version 1.0 | |
* @see https://github.com/mesgarpour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
import csv | |
import datetime | |
import time | |
import twitter | |
def test(): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys' |
OlderNewer