Skip to content

Instantly share code, notes, and snippets.

View persand's full-sized avatar
🙈
Being patched by monkeys

Per Sandström persand

🙈
Being patched by monkeys
View GitHub Profile
@hyperupcall
hyperupcall / settings.jsonc
Last active June 26, 2024 18:59
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@rosenpin
rosenpin / protonmail-delete-all-in-folder.js
Created August 11, 2018 13:39
Delete all emails in an open folder in Protonmail
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function deleteAllMails(){
for (var i = 0;i<100;i++){
setTimeout(function(){document.getElementById("selectAll").click()},1000);
setTimeout(function(){document.getElementsByClassName("moveElement-btn-delete")[0].click()},3000);
setTimeout(function(){document.getElementById("confirmModalBtn").click()},5000);
await sleep(10000)
@joakim
joakim / path_save_subpage_alias.php
Last active December 25, 2015 18:49
Drupal: Save additional path aliases for subpages. Could be used with nodes to make node/123/edit (with alias "foo") look like foo/edit. Prettier.
/**
* Implements hook_node_presave().
*/
function custom_node_presave($node) {
// Get the source of the "base" path which has subpages.
$source = 'node/' . $node->nid;
// If the node's alias is "foo", foo/edit will be an alias for node/123/edit.
custom_save_subpage_alias($source, 'edit');
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@emilbjorklund
emilbjorklund / breakpoints_via_css.html
Created April 24, 2012 16:03
Width detection via sneaky CSS rules
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */
@simme
simme / install-drupal.sh
Created October 27, 2011 14:11
Download and install Drupal 'n stuff
#!/bin/bash
SITES_DOMAIN="simme"
# # # # # # # # # # # # # # # # # # # # # # #
E_BADARGS=65
if [ ! -n "$1" ]
then
echo "Usage: `basename $0` sitename"
@inky
inky / README
Created July 6, 2011 17:46
Jekyll plugin to selectively allow blog posts to use PHP.
Jekyll plugin to selectively allow blog posts to use PHP.
Copy php_posts.rb to your _plugins folder. Set 'php: yes' on a post, and
Jekyll will generate an 'index.php' file for it (rather than 'index.html').
This has only been tested with the following permalink format:
/:year/:title/
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@defunkt
defunkt / installing-Mustache.tmbundle.md
Created March 6, 2010 10:27
Installing Mustache.tmbundle