Skip to content

Instantly share code, notes, and snippets.

View dealingwith's full-sized avatar

Daniel Miller dealingwith

View GitHub Profile
@dealingwith
dealingwith / casper-screenshot-example.js
Created April 22, 2016 20:14
Failing to get Facebook screenshots via Casper
var casper = require("casper").create(),
urls = [
'https://www.facebook.com/ModernApartmentCommunity/',
'https://www.facebook.com/ModernApartmentCommunity/reviews/'
'http://modernmsg.com',
'http://modernmsg.com/rewards'
],
saveDir = 'shots'
casper.start();
@dealingwith
dealingwith / gist:8b0b8d9c520a2a9093f50c1eda25bf7a
Created January 25, 2017 02:08
Simulation of the game "Friends & Neighbors"
// 14 chips
// 9 squares on board
// 5 on the stop sign
var lostcount = 0;
var wincount = 0;
var board = [0,1,2,3,4,5,6,7,8];
var iterations = 1000000;
<style>
#wrap {
position: fixed;
top: 0;
right:0;
bottom:0;
left: 0;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
@dealingwith
dealingwith / 200wad.rb
Last active March 30, 2019 04:34
200wordsaday.com export script
# uses the 200wordsaday.com API to export your posts as text files
# to install httparty:
# gem install httparty
require 'httparty'
require 'json'
require 'date'
url = 'https://200wordsaday.com/api/texts?api_key=<your api key>'
response = HTTParty.get(url)
entries = response.parsed_response
@dealingwith
dealingwith / trello-stylish.css
Last active October 22, 2020 03:03
Trello Stylish
body, button, html, input, select, textarea {
font-family: sans-serif;
font-size: 0.9rem;
}
.board-header-btn.board-header-btn-enabled.js-star-board {
background-color: transparent;
}
.board-header-btn.board-header-btn-enabled.js-star-board span:before {
@dealingwith
dealingwith / zenhub.css
Created March 30, 2019 04:33
Zenhub Stylish
.zhc-label {
border-radius: 8px;
font-weight: normal;
padding: 2px 5px 2px;
}
.zhc-issue-card__issue-title {
font-weight: normal;
}
@dealingwith
dealingwith / mbe01-mbe07.java
Last active May 18, 2019 04:26
Showing the diff of a simple Minecraft block and one that drops items
public class BlockDropper extends Block
{
public BlockDropper()
{
super(Material.ROCK);
this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS); // the block will appear on the Blocks tab in creative
this.setHardness(0.5f);
}
@SideOnly(Side.CLIENT)
* {
font-family: Ubuntu !important;
}
::-webkit-scrollbar {
width: 0px;
height: 0px;
background: transparent;
}
@dealingwith
dealingwith / facebook-stylish-styles
Created March 22, 2020 17:26
facebook-stylish-styles.css
/* hide stories */
#ssrb_stories_start + div {
display: none;
}
@dealingwith
dealingwith / notion_metadata_toggle.js
Last active December 25, 2020 14:33
Bookmarklet for toggling Notion metadata
javascript:(function(){var metadata = document.querySelector("#notion-app > div > div.notion-cursor-listener > div.notion-frame > div.notion-scroller.vertical.horizontal > div:nth-child(2)"); if (metadata.style.display == "") {metadata.style.display = "none";} else {metadata.style.display = "";} })();