Skip to content

Instantly share code, notes, and snippets.

View anselmdk's full-sized avatar

Anselm Christophersen anselmdk

View GitHub Profile
@jphorn
jphorn / firebuglite-ios.js
Created December 4, 2011 20:55
Firebug LITE for iOS
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
@phptek
phptek / ss-upgrade.sh
Last active October 11, 2015 18:38 — forked from stojg/ss-upgrade.sh
Search and replace for SS 3.0 upgrade [beta]
#!/bin/bash
#
# ss-upgrader.sh
#
# INTRODUCTION
#
# There are some threads on the SS forums that describe the techdocs for upgrading a 2.4 site to 3.x as being too technical. Mainly from content authors who
# also happen to be site maintainers - they are not coders.
# The aim of this script is to therefore to automate - in as much as this is possible in a user-configured, open-source software project - to help those new to
# SS3 upgrade from 2.x as smoothly as possible.
@ryanwachtl
ryanwachtl / SilverStripe Foundation HtmlEditorConfig
Last active December 21, 2015 04:39
HtmlEditorConfig for SilverStripe Foundation Theme. Also sets up a minimal, single line toolbar.
HtmlEditorConfig::get('cms')->setOptions(array(
"skin" => "default",
"style_formats" => array(
array(
"title" => "Lead",
"selector" => "p",
"classes" => "lead"
),
array(
"title" => "Subheader",
@shawnrice
shawnrice / skeleton-daemon.sh
Created April 19, 2014 07:22
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@markguinn
markguinn / CreateViewForClass.php
Last active January 5, 2017 15:44
Create MySQL view for multi-table Silverstripe DataObject
<?php
/**
* Creates a Flat table view for a given class
* @author Mark Guinn <mark@adaircreative.com>
* @date 06.13.2014
*/
class CreateViewForClass extends BuildTask
{
protected $title = 'DEV: Flat View for Class';
protected $description = 'Use class=XXXX to create a flat view of all the tables that make up a given class';
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active August 13, 2020 15:18
JSX Spread Attributes

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@curtismcmullan
curtismcmullan / setup_selenium.sh
Last active May 2, 2023 22:56
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active February 24, 2024 04:41
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@sadikaya
sadikaya / git-bash-in-webstorm.md
Last active February 13, 2024 01:23
git bash inside Webstorm terminal

Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.

for 64bit:

"C:\Program Files\Git\bin\sh.exe" --login -i

for 32bit:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@Landish
Landish / jsconfig.md
Last active May 25, 2023 13:47
jsconfig.json

jsconfig.json

{
  "compilerOptions": {
    "baseUrl": "./src",
    "target": "ES6",
    "jsx": "preserve",
    "allowSyntheticDefaultImports": true
  },
 "exclude": ["build", "node_modules"]