Skip to content

Instantly share code, notes, and snippets.

@KohnoseLami
KohnoseLami / key.md
Created September 9, 2020 09:44
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@Behinder
Behinder / gist:166bf67259268caa98675c849ecf0395
Created April 18, 2020 15:27
Increment and decrement float in PHP
function incrementFLoat($float){
echo $float."\n";
$decimal = strlen(strrchr($float, '.')) -1;
$factor = pow(10,$decimal);
$incremented = (($factor * $float) + 1) / $factor;
return $incremented;
}
function decrementFLoat($float){
// get amount of decimals
@bradtraversy
bradtraversy / docker_wordpress.md
Last active July 11, 2024 00:07
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@maddisondesigns
maddisondesigns / functions.php
Last active February 7, 2024 13:42
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@Crissov
Crissov / fb-emoji-scraper.js
Last active August 15, 2018 16:34
Scrape Facebook emojis
let content_security_policy = "script-src 'self'; object-src 'self' https://www.facebook.com/"; // for running in Chrome's JS console
/* Let’s see which Unicode 10.0 emojis Facebook already supports.
<https://github.com/Crissov/unicode-proposals/issues/254#issuecomment-284831620> */
let myEmojis = new Map([
['1f6f7', 'U+1F6F7 🛷 SLED'],
['1f6f8', 'U+1F6F8 🛸 FLYING SAUCER'],
['1f91f', 'U+1F91F 🤟 I LOVE YOU HAND SIGN'],
['1f928', 'U+1F928 🤨 FACE WITH ONE EYEBROW RAISED'],
['1f929', 'U+1F929 🤩 GRINNING FACE WITH STAR EYES'],
['1f92a', 'U+1F92A 🤪 GRINNING FACE WITH CRAZY EYES'],
@vinicius-stutz
vinicius-stutz / README.md
Created December 30, 2015 13:41
Google Chrome Favicons For Bookmarklets

Google Chrome Favicons For Bookmarklets

  1. Open the Bookmark Manager and export your bookmarks;
  2. Open the exported html file in your favorite editor and look for the bookmarklet you want a favicon applied to;
  3. Convert the 16x16 px (or greater) favicon you want to use into the BASE64 format (I used Base64 Image Encoder);
  4. Now you can add the favicon via adding the ICON="data:image/insert-your-base64-image-code-here" attribute in the link;
  5. Save the file and import it in the bookmark manager.

Done! If the favicon doesn’t show up, try clicking on the bookmarklet. Afterwards the changes should stick and you can delete the imported bookmarks folder. If you have sync activated the favicons on your bookmarklets will also show up on your other PC, Mac, smartphone etc.

@toshimaru
toshimaru / jquery-scroll-bottom.js
Last active May 31, 2022 10:55
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@kamranzafar
kamranzafar / toast.js
Created July 18, 2012 14:40
JQuery Mobile Android-style Toast popup
var toast=function(msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })