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
/** | |
Please Note that this script is for Discourse Forum | |
To move all posts in the CURRENT category to another category | |
For example i want to move all the topics in the current category to category number 70 | |
Just open the category. open Developer tools, paste this in the console and type the command moveAndDeleteCategory("70") | |
You can get the category id by going to /site.json | |
*/ | |
function whenElementExistsThenDo(selector, fn, count) { | |
if (!count) count = 0; |
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
let load = function(){ | |
if($('a:contains("Why not create a topic?")').length > 0) | |
return console.log("LoadAll: Loading Complete") | |
setTimeout(function(){ | |
$("html, body").animate({ scrollTop: $(document).height() }, 1); | |
load() | |
},10) | |
} | |
load() |
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
const webhook_uri = "WEBHOOK URL HERE"; | |
const spawn = require('child_process').spawn; | |
const request = require('request'); | |
var pm2 = false; | |
let queue = []; | |
function createChunks(str) { | |
return str.match(new RegExp('.{1,' + 2000 + '}', 'g')); | |
} | |
function send(data) { |
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
const config = { | |
filepath: "./file.log", | |
line_delimiter: "\n", | |
line_should_contain: "permit", | |
to_remove: [/[\r\n]/g], | |
original_column_delimiter: " ", | |
columns_to_be_removed: [1, 2, -1, -2] | |
} | |
const fs = require('fs'); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
#define MAX_SIZE 100 | |
struct | |
{ | |
int top; | |
char items[MAX_SIZE]; | |
} typedef Stack; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
#define MAX_SIZE 100 | |
struct | |
{ | |
int top; | |
char items[MAX_SIZE]; | |
} typedef Stack; |
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
/** | |
Infix to postfix | |
Write a C program to convert and print a given valid parenthesized infix arithmetic expression to postfix expression. The expression consists of single character operands and +,-, *, / operators. | |
Constraints: only four operators used +, -, *, / . | |
Input format: | |
Input consists of a string which consists of infix expression. | |
The output consists of an postfix expression. If the input In-fix expression consists of an operator other than Arithmetic operators mentioned above print "Invalid Input". | |
Refer sample input and output for formatting specifications. |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX_SIZE 3 | |
struct{ | |
int front; | |
int rear; | |
int a[MAX_SIZE]; | |
int size; | |
} typedef Queue; | |
void insert(Queue*, int); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct node | |
{ | |
int info; | |
struct node *next; | |
}; | |
typedef struct node *Node; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct node | |
{ | |
int id; | |
char name[50]; | |
int sem; | |
struct node *next; |
OlderNewer