This file contains hidden or 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
    
  
  
    
  | import os, re, json, requests, mysql.connector | |
| from textwrap import dedent | |
| MYSQL_CONFIG = { | |
| "host": "127.0.0.1", | |
| "port": 3306, | |
| "user": "mydbuser", | |
| "password": "mydbpassword01", | |
| "database": "mydb", | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/bin/bash | |
| # kill-vscode-server.sh - Script to kill VS Code server processes | |
| # Configure: | |
| # nano kill-vscode-server.sh | |
| # chmod +x kill-vscode-server.sh | |
| # Usage: | |
| # Interactively, with confirmation prompt | |
| # ./kill-vscode-server.sh | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| // git.php | |
| class git { | |
| function mini_hash() { | |
| return substr(file_get_contents('.git/'. trim(explode(' ', file_get_contents('.git/HEAD'))[1])), 0, 7); | |
| } | |
| function hash() { | |
| return trim(file_get_contents(".git/". trim(explode(" ", file_get_contents(".git/HEAD"))[1]))); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | proc usr_mode {nick target mode args} { | |
| call usr:rawmode $nick $target $mode $args | |
| # this happens when a mode is changed (for channel or user) in the form of: | |
| # MODE <target> +mo-de arg arg arg | |
| # it then breaks it up and sends it to usr_modechange in the form of: | |
| # MODE <target> +m | |
| # MODE <target> +o arg | |
| # MODE <target> -d arg | |
| # MODE <target> -e arg | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| // details for your database | |
| $DB = array( | |
| 'hostname' => 'localhost', | |
| 'username' => 'gamedb', | |
| 'password' => 'gamedb1234!', | |
| 'database' => 'gamedb' | |
| ); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| $val1 = $_REQUEST ['val1']; // calc.php?val1=<num> (or POST/COOKIE) | |
| $val2 = $_REQUEST ['val2']; // calc.php?val2=<num> (or POST/COOKIE) | |
| $calc = $_REQUEST ['calc']; // calc.php?calc=<add|sub|mul|div> (or POST/COOKIE) | |
| if (is_numeric ($val1) && is_numeric ($val2)) { // check if we have a number for val1/val2 | |
| $result = 0; // set the default result to 0 | |
| switch ($calc){ // check the value of calc | |
| case "add" : // if calc is 'add', add up the two numbers | 
  
    
      This file contains hidden or 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
    
  
  
    
  | package net.nictitate.boredBOT; | |
| public class GetServer { | |
| private boredBOT client; | |
| public static void process(boredBOT client, String read_data) { | |
| System.out.println("<- " + read_data); | |
| if (read_data.length() == 0) { | |
| // just some santising, in case nothing comes through | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Imports System.Drawing | |
| Imports System.Drawing.Imaging | |
| Imports System.IO | |
| Imports System.Text | |
| Module ModifyDateTaken | |
| Private DATE_TAKEN = &H132 ' Code for date taken | |
| Private DateNull = DateTime.ParseExact("1000/01/01 01:01:01", "yyyy/MM/dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) ' A 'Null' type thing, because I couldn't be bothered working how to Null a date.. | |
| Sub Main() | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| /* ssl.php | |
| * ssl lookup | |
| * | |
| * Needs to be stored in DB, Run via Cron and Have a front end to allow users to add/remove and run manually - | |
| * | |
| */ | |
| // check the ssl expiry dates for certain sites | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| /* list.php | |
| * Assisting /u/NotYourIT | |
| * URL: https://www.reddit.com/r/PHPhelp/comments/53aah1/php_reading_text_file_with_eol_marker_and_eof/ | |
| */ | |
| // your grades file | |
| $FILE = 'grades.txt'; | |
| // open the grades file |