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
#!/bin/bash | |
# | |
# WARNING: CPU MINING IS UNPROFITABLE! (FOR HOBBY / EXPERIMENT / RESEARCH ONLY) | |
# | |
# RASPBERRY PI CPUMINER-MULTI SETUP SCRIPT | |
# | |
# RASPBERRY PI, DOGE, DOGECOIN, PROHASHING.COM, LITECOIN, MINING | |
# |
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
/* Minifies HTML and removes comments (except IE tags and comments within script tags) | |
* | |
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag | |
* | |
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q | |
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html | |
*/ | |
class WP_HTML_Compression | |
{ | |
// Settings |
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
<?php | |
/* We can use the pre_get_posts action hook to modify a query before it's run. | |
* http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts*/ | |
add_action( 'pre_get_posts', 'kvn_rem_pp' ); | |
function kvn_rem_pp($query){ | |
if(current_user_can ('read_private_posts') ){ | |
/*restrict to the posts page main query. | |
*All other views (eg. category archives) unnaffected | |
*http://codex.wordpress.org/Function_Reference/is_home | |
*http://codex.wordpress.org/Function_Reference/is_main_query*/ |
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
# !!! IMPORTANT | |
# Must point to the correct director or this entire script breaks | |
eval $(/opt/homebrew/bin/brew shellenv) | |
# The next line updates PATH for the Google Cloud SDK. | |
if [ -f '/usr/local/google-cloud-sdk/path.bash.inc' ]; then . '/usr/local/google-cloud-sdk/path.bash.inc'; fi | |
# The next line enables shell command completion for gcloud. | |
if [ -f '/usr/local/google-cloud-sdk/completion.bash.inc' ]; then . '/usr/local/google-cloud-sdk/completion.bash.inc'; fi |
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
<?php | |
// rewrite /wp-content/themes/theme-name/css/ to /css/ | |
// rewrite /wp-content/themes/theme-name/js/ to /js/ | |
// rewrite /wp-content/themes/theme-name/img/ to /img/ | |
// rewrite /wp-content/plugins/ to /plugins/ | |
function roots_flush_rewrites() { | |
global $wp_rewrite; | |
$wp_rewrite->flush_rules(); | |
} |
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 isArray(data: any): Boolean { | |
return data && data.constructor === Array; | |
} | |
function isObject(data: any): Boolean { | |
return data && data.constructor === Object; | |
} | |
function withoutEdgesAndNodes(data: any): any { | |
let result = Array.isArray(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
import * as request from 'request'; | |
import * as fs from 'fs'; | |
import * as readline from 'readline'; | |
var google = require('googleapis'); | |
var googleAuth = require('google-auth-library'); | |
/*************** STEPS | |
- made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing? |
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
import openai | |
from colorama import Fore | |
from langchain import PromptTemplate | |
from langchain.chains import ConversationalRetrievalChain, RetrievalQA | |
from langchain.chat_models import ChatOpenAI | |
from langchain.document_loaders import TextLoader | |
from langchain.embeddings import HuggingFaceEmbeddings | |
from langchain.memory import ConversationBufferMemory | |
from langchain.schema import SystemMessage | |
from langchain.text_splitter import RecursiveCharacterTextSplitter |
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
var application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
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
_BUCKET_NAME="foo.example.com" | |
_POLICY=$(cat <<EOT | |
{ | |
"Version":"2012-10-17", | |
"Statement":[{ | |
"Sid":"PublicReadForGetBucketObjects", | |
"Effect":"Allow", | |
"Principal": "*", | |
"Action":["s3:GetObject"], |
OlderNewer