Skip to content

Instantly share code, notes, and snippets.

View beatricebock's full-sized avatar

Beatrice beatricebock

View GitHub Profile

Keybase proof

I hereby claim:

  • I am beatricebock on github.
  • I am beatricebock (https://keybase.io/beatricebock) on keybase.
  • I have a public key ASAcy7v7C3W3C-uG54hFFQ3GE0JHec18lRYoRO3vorU7jAo

To claim this, I am signing this object:

@beatricebock
beatricebock / gulpfile.js
Created July 29, 2020 15:20
Gulpfile that works for simple scss/html, Modified from this tutorial: https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync
var gulp = require("gulp");
var browserSync = require("browser-sync").create();
var sass = require("gulp-sass");
// Compile sass into CSS & auto-inject into browsers
gulp.task("sass", function () {
return gulp
.src("app/scss/**/*.scss")
.pipe(sass())
.pipe(gulp.dest("app/css"))
@beatricebock
beatricebock / custom_vc_components.md
Last active September 6, 2017 07:12
Add custom component (existing shortcode) to visual composer
  1. Add shortcode (in functions.php or equivalent)
  	add_shortcode('shortcode-name', function($params){
  		include(get_template_directory() . '/path/to/shortcode.php');
  	});
  1. Add action
  	add_action( 'vc_after_init', 'add_shortcode');
  	function add_shortcode() {
@beatricebock
beatricebock / vc_config.php
Last active September 7, 2017 02:51
Customize element settings in visual composer - add, remove, edit component settings
<?php
//Add in functions.php or any other class file.
add_action( 'vc_after_init', 'configure_vc_btn'); //register
function configure_vc_btn()
{
//remove params(settings)
if( function_exists('vc_remove_param') ){
WPBMap::dropParam( 'vc_btn', 'css_animation' );
@beatricebock
beatricebock / app.js
Created August 29, 2017 04:23
Pagination with jquery
//paginate on load
$('.organization-list').each(function () {
paginate($(this));
$(this).find('.pagination').first().trigger("click"); //paginations won't show the first page if not clicked, so trigger the first click
});
//paginate on list change
$('select.filter').change(
function () {
$parent = $(this).parents('.organization-list');
@beatricebock
beatricebock / automatedatanchor.html
Created August 29, 2017 03:05
jQuery snippet for automating adding "target"="_blank" to anchor tags
<!-- just copy-paste this snippet, paste it in your own file, edit it, then run it in your browser. Then, inspect the generated code and copy the generated html. No more copy-pasting code into your a tags and missing a few cos you're (i'm) a clutz. ezpz -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
@beatricebock
beatricebock / deploy-jekyll-with-github.md
Last active February 24, 2017 07:32
How to deploy a Jekyll website using Github

Jekyll is a gem based on Ruby and Rails. It's a framework-type thing that people use to create blogs quickly. Jekyll is great because it's simple, but powerful. Devs love it because working with and managing content using Jekyll is a lot like coding, so it's an environment we're all familiar with. Jekyll allows you to have a static site up and running in literal minutes.

  1. Initialize a github repo using this format: your-username.github.com. For me, it'll look like this: trisssss.github.io.

  2. In your local computer, install the Jekyll Gem (make sure you have Ruby and Rails installed beforehand) by typing: gem install Jekyll in your shell.

  3. After the gem has been installed, type jekyll new your-folder-name into the shell. You can replace "your-folder-name" with anything you want.

  4. Navigate into your new folder using cd. For example, I'll type cd your-folder-name since "your-folder-name" was what I created by new Jekyll folder with.