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 React, { useState, useEffect } from 'react'; | |
const App = () => { | |
const [relevantSources, setRelevantSources] = useState([]); | |
const [answer, setAnswer] = useState(''); | |
const [identifiers, setIdentifiers] = useState(null); | |
const [error, setError] = useState(null); | |
const [feedback, setFeedback] = useState(null); | |
const process_stream = async (response) => { |
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
//hover over section and underline heading | |
section{ | |
h2 { | |
text-decoration: none; | |
letter-spacing: 0.15em; | |
display: inline-block; | |
padding: 10px 0; | |
position: relative; | |
} |
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
# ie List is a normal list: | |
# 104.txt | |
# 105.txt | |
# 106.txt | |
# 107.txt | |
# 108.txt | |
# When done with code below should give me 5x files with a .txt extension, ie 104.txt, 105.txt. Can be any file ext. | |
List = open("64-120/rename.txt") |
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
<div class="articles-list mb-5"> | |
<div class="row"> | |
@{ | |
int pageSize = 2; // How many items per page | |
int page; // The page we are viewing | |
/* Set up parameters */ | |
if (!int.TryParse(Request.QueryString["page"], out page)) | |
{ |
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
//-------------------- Add SCSS Loaders -------------------------// | |
// In order to access the config files, we would runnpm run eject to eject the build scripts from starter app. You'll be asked for approval because the action is // permanent. Once this command has successfully run, you should see a config and scripts folder created. They contain all the build scripts necessary for // building the started app. Among them is the webpack.config.dev.js and webpack.config.prod.js files, which is our focus. | |
// | |
// Also note that npm run eject updates your dependencies with other packages which it has previously abstracted from you. You can view those new dependencies in // your package.json. | |
// First run npm i sass-loader and npm i node-sass —save to install sass-loader to help in compiling your scss to css. | |
// Next, edit the webpack.config.dev.js in the config folder as follows. Add the loaders to configure the webpack, to compile our scss files. | |
// Add this after the loader: require.resolve('postcss-loader') dec |
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 os | |
""" | |
Renames the filenames within the same directory to be Unix friendly | |
(1) Changes spaces to hyphens | |
(2) Makes lowercase (not a Unix requirement, just looks better ;) | |
Usage: | |
python rename.py | |
""" |
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
def findReplace(directory, find, replace, filePattern): | |
for path, dirs, files in os.walk(os.path.abspath(directory)): | |
for filename in fnmatch.filter(files, filePattern): | |
filepath = os.path.join(path, filename) | |
with open(filepath) as f: | |
s = f.read() | |
s = s.replace(find, replace) | |
with open(filepath, "w") as f: | |
f.write(s) | |
MYPATH = "folder/folder" |
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
from __future__ import print_function | |
from __future__ import absolute_import | |
from distutils.dir_util import copy_tree | |
import os | |
import sys | |
import glob | |
import json | |
import re | |
import shutil |
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
// How to split a wordpress bootstrap loop into multiple columns | |
/** This goes into template **/ | |
<?php $the_query = new WP_Query('cat=1&showposts=50&orderby=title&order=asc');?> | |
<?php foreach(new WP_Query_Columns($the_query, 10) as $column_count) : ?> | |
<ul> | |
<?php while ($column_count--) : $the_query->the_post(); ?> | |
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> | |
<?php endwhile; ?> | |
</ul> |
NewerOlder