Skip to content

Instantly share code, notes, and snippets.

View stevenroh's full-sized avatar
🇨🇭

Steven Roh stevenroh

🇨🇭
View GitHub Profile
@stevenroh
stevenroh / parallax-no.css
Created November 1, 2018 09:58 — forked from marisqaporter/parallax-no.css
disable parallax effect on parallax pro theme by genesis
/* Disable Parallex effect on Home Sections 1, 2, and 3
--------------------------------------------- */
.home-section-1, .home-section-3, .home-section-5 {
background-attachment: scroll;
background-color: #fff;
background-position: 50% 0px;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
@stevenroh
stevenroh / random.md
Created October 26, 2018 19:45 — forked from joepie91/random.md
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@stevenroh
stevenroh / crack_word_2013_encryption.txt
Created October 4, 2018 16:24
Crack Office Word 2013 Encryption
office2john.py file.docx > hash.txt
hashcat -a 0 -m 9600 hash.txt 1000000-password-seclists.txt -o found.txt --username
cat found.txt
@stevenroh
stevenroh / clear.txt
Created March 28, 2018 08:12 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
@stevenroh
stevenroh / pll_copy_post_metas.php
Created December 20, 2017 08:37 — forked from qstudio/pll_copy_post_metas.php
WP / PolyLang / Un-Sync Specified Custom Fields
<?php
// filter to exclude specified post_meta from Polylang Sync ##
add_filter( 'pll_copy_post_metas', 'q_pll_copy_post_metas' );
/**
* Remove defined custom fields from Polylang Sync
*
* @since 0.1
* @param Array $metas
@stevenroh
stevenroh / facetwp_radio_button_image.php
Created December 5, 2017 15:56
Add an image to the facet radio button
<?php
add_filter( 'facetwp_facet_html', function( $output, $params ) {
if ( 'your_facet' == $params['facet']['name'] ) {
$output = '';
$values = (array) $params['values'];
$selected_values = (array) $params['selected_values'];
foreach ( $values as $result ){
$selected = in_array( $result['facet_value'], $selected_values ) ? ' checked' : '';
@stevenroh
stevenroh / mosaic_extract.py
Last active February 9, 2018 23:23
mosaic_extract
from PIL import Image
im = Image.open("mosaic.png")
width, height = im.size
pixels = im.load()
for x in range(50, width, 100):
for y in range(50, height, 100):
pixel = pixels[x, y][2]
print chr(pixel),

Keybase proof

I hereby claim:

  • I am stevenroh on github.
  • I am rohs (https://keybase.io/rohs) on keybase.
  • I have a public key ASCSPcwgKk5ioCaE00TQcOcjgDDdnS2xi-qOVGiyrPC1EAo

To claim this, I am signing this object:

add_action( 'admin_bar_menu', 'remove_wp_theme_mynode', 999 );
function remove_wp_theme_mynode( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'NODE_ID' );
}
.wpcf7-form-control-wrap input[type="text"], .wpcf7-form-control-wrap input[type="tel"], .wpcf7-form-control-wrap input[type="email"], .wpcf7-form-control-wrap textarea, .wpcf7-form-control-wrap select {
padding: 10px 8px;
border-radius: 2px;
border: 1px solid black;
border: 1px solid rgba(0,0,0,0.2);
width:100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}