Skip to content

Instantly share code, notes, and snippets.

@ianoxley
ianoxley / ctags definitions for Javascript
Last active June 9, 2017 12:59 — forked from tim-smart/ctags definitions for Javascript
CTags Definitions for Javascript
View ctags definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|const|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Z
View CsvActionResult.cs
using System;
using System.Data;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Mvc;
public sealed class CsvActionResult : FileResult
{
private readonly DataTable _dataTable;
View favicon.sh
#!/usr/bin/bash
# Favicon and Apple Touch Icon Generator
#
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
#
# * apple-touch-icon-144x144-precomposed.png
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
View fullscreen.css
:-webkit-full-screen .gist {
overflow-y:auto;
}
@ianoxley
ianoxley / smokeonthewater.py
Created August 21, 2012 17:56
Smoke on the Water for Lego Mindstorms
View smokeonthewater.py
#!/usr/bin/env python
#
# Smoke on the water by Deep Purple, for the Lego Mindstorms
#
# Note frequencies worked out as follows:
# A = 440
# Notes above A = A * (1.059463)^ no. of steps above A
# Notes below A = A * (1.059463)^ -no. of steps below A
#
View weather.py
#!/usr/bin/env python
""" Script that prints out tomorrow's weather forecast, using the Yahoo Weather API.
You'll need to get your location's WOEID, which you can get from entering your
location in the form on http://weather.yahoo.com/ - currently where it says
'Enter city of zip code'.
The WOEID numerical id will be in the URL of the page you get redirected to
after submitting the form e.g. in the URL
http://weather.yahoo.com/united-kingdom/england/newcastle-upon-tyne-30079/ the
@ianoxley
ianoxley / canvas_transform.html
Created June 28, 2012 15:38
Canvas transformations demo
View canvas_transform.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Canvas Transforms</title>
<style>
canvas {
border:1px solid #ccc;
}
</style>
@ianoxley
ianoxley / AssemblyInfo.cs
Created May 21, 2012 08:11
Code snippets for the Albacore article
View AssemblyInfo.cs
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("ACME")]
[assembly: AssemblyProduct("AlbacoreDemo")]
[assembly: AssemblyCopyright("Wile E. Coyote")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@ianoxley
ianoxley / console.xml
Created March 16, 2012 16:15
Console2 settings file
View console.xml
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="25" columns="80" buffer_rows="500" buffer_columns="0" shell="" init_dir="" start_hidden="0" save_size="0">
<colors>
<color id="0" r="0" g="0" b="0"/>
<color id="1" r="0" g="0" b="128"/>
<color id="2" r="0" g="150" b="0"/>
<color id="3" r="0" g="150" b="150"/>
<color id="4" r="170" g="25" b="25"/>
<color id="5" r="128" g="0" b="128"/>
@ianoxley
ianoxley / Config.cs
Created March 7, 2012 17:38
A dynamic config object to access <appSettings>
View Config.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Dynamic;
using System.Collections.Specialized;
namespace Ox.Models
{