Skip to content

Instantly share code, notes, and snippets.

@Decad
Decad / playlist.py
Created April 19, 2012 18:43
Make a vlc playlist for a directory
from xml.dom.minidom import Document
import os
import sys
validExt = ('.avi') #only add files with these extensions to the playlist
if(len(sys.argv) > 1):
rootdir = sys.argv[1]+'/'
print(sys.argv[1])
else:
@Decad
Decad / A-Pen-by-Declan-Cook.markdown
Created October 21, 2013 23:04
A Pen by Declan Cook.
@Decad
Decad / faupgrade.js
Created October 24, 2013 17:07
Font Awesome Upgrade 3.x - 4.0
/*
* Quickly made upgrade script from running through html files and replacing old font awesome classes with new. Be warned will make changes to any icon-* classes
*
* Author: Declan Cook
* Usage: node faupgrade.js <htmlfile>
*/
var fs = require('fs'),
lookup = {"ban-circle":"ban","bar-chart":"bar-chart-o","beaker":"flask","bell":"bell-o","bell-alt":"bell","bitbucket-sign":"bitbucket-square","bookmark-empty":"bookmark-o","calendar-empty":"calendar-o","check":"check-square-o","check-empty":"square-o","check-minus":"minus-square-o","check-sign":"check-square","chevron-sign-down":"chevron-circle-down","chevron-sign-left":"chevron-circle-left","chevron-sign-right":"chevron-circle-right","chevron-sign-up":"chevron-circle-up","circle-arrow-down":"arrow-circle-down","circle-arrow-left":"arrow-circle-left","circle-arrow-right":"arrow-circle-right","circle-arrow-up":"arrow-circle-up","circle-blank":"circle-o","collapse":"caret-square-o-down","collapse-alt":"collapse-o","collapse-top":"caret-square-o-up","comment-a
@Decad
Decad / install.bat
Created March 3, 2014 09:07
Install Chocolatey using system default proxy
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$wc=new-object net.webclient; $wc.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$wc.DownloadString('https://chocolatey.org/install.ps1') | iex" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
@Decad
Decad / perf.js
Created October 14, 2014 10:13
perf
var gZeroLeft = 0;
var gZeroTop = 0;
var gWinWidth = window.innerWidth || document.documentElement.clientWidth;
function findImages() {
var aElems = document.getElementsByTagName('*');
var re = /url\((http.*)\)/ig;
for ( var i=0, len = aElems.length; i < len; i++ ) {
var elem = aElems[i];
var style = window.getComputedStyle(elem);
git log --author="<Name>" | grep Date | awk '{print " : "$4" "$3" "$6}' | uniq -c
@Decad
Decad / pre-commit.sh
Created November 27, 2017 20:01 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
@Decad
Decad / .dircolors.wsl
Created July 16, 2019 00:26 — forked from sgur/.dircolors.wsl
Dircolors for WSL
# dircolors for WSL
# Usage: eval `dircolors ~/.dircolors.wsl` (bash)
# http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
TERM Eterm
TERM ansi
TERM color-xterm
TERM con[0-9]*x[0-9]*
TERM cons25
In your all your plugins you extend QuirkPlugin now not CSharpPlugi.
Then you can put `[ChatCommand("auth")]` style attributes on your chat commands rather than register them
@Decad
Decad / main.py
Last active September 20, 2020 19:49
Wildcards with snips-nlu
from __future__ import unicode_literals, print_function
import io
import json
from snips_nlu import SnipsNLUEngine
from snips_nlu.default_configs import CONFIG_EN
from snips_nlu.dataset import Dataset
with io.open("dataset/remind.yaml") as f:
dataset = Dataset.from_yaml_files("en", [f])