This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace GitHub.Gist { | |
/// <summary> | |
/// Extension methods for working with strings | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- simple | |
- public over private | |
- personal vanity | |
- internet is global | |
- permalinks | |
- one important item per page | |
- don't break the browser | |
- don't wanker in technology | |
- a medium is not a grande | |
- break convention for your users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Github.Gist.Logging { | |
public interface ILogger { | |
void Warn(string s); | |
void Warn(string s, Exception ex); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System | |
def is_assembly_debug_build(filename): | |
"""Returns true if filename appears to have been built in debug mode""" | |
result = False | |
dll = System.Reflection.Assembly.LoadFile(filename) | |
customAttribs = dll.GetCustomAttributes(False) | |
for att in customAttribs: | |
if att.GetType() == System.Type.GetType("System.Diagnostics.DebuggableAttribute"): | |
result = att.IsJITTrackingEnabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:⌉ | |
=⌉ | |
¦-) as opposed to | | |
☺ | |
☹ | |
☻ | |
⍣ | |
⍤ | |
⍥ om nom nom | |
⍨ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (self != top) { | |
document.documentElement.style.visibility = 'hidden'; | |
top.location = self.location; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy a file's contents to the clipboard | |
cat filename | xclip -sel clip | |
# Generate a random password | |
date | md5sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formutils_form_alter(&$form, &$form_state, $form_id) { | |
if (is_array($form['submitted'])) { | |
foreach ($form['submitted'] as $field) { | |
if (!$field['#required']) { | |
$currentTitle = $field['#title']; | |
$field['#title'] = $currentTitle . ' (optional)'; | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'ALTER TABLE [' + TABLE_SCHEMA + '].[' + TABLE_NAME + '] ALTER COLUMN [' + COLUMN_NAME + '] nvarchar(' + CAST(CHARACTER_MAXIMUM_LENGTH As NVARCHAR) + ');' | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE DATA_TYPE = 'VARCHAR'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%title Example HAML | |
/[if IE] | |
%link{ :rel => "stylesheet", :href => "/css/ie.css" } | |
%body | |
#container | |
%header | |
%h1 Our Awesome HTML5 Template |
OlderNewer