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 unique(value, index, self) { | |
return self.indexOf(value) === index; | |
} |
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
CREATE TABLE #TestData ( | |
id int not null identity(1,1) primary key, | |
account varchar(10) not null, | |
deposit int not null | |
); | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 10) | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 20) | |
INSERT INTO #TestData (account, deposit) VALUES ('Vacation', 30) | |
INSERT INTO #TestData (account, deposit) VALUES ('Bills', 40) | |
INSERT INTO #TestData (account, deposit) VALUES ('Bills', 50) |
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
declare @table table(id int, strings nvarchar(400)) | |
insert into @table (id, strings) | |
select 1, 'abc,def,ghi' | |
union all | |
select 2, 'jkl' | |
union all | |
select 3, 'mno,pqr' | |
select * from @table |
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
#!/bin/sh | |
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin | |
#---------------------------------------------------- | |
# a simple mysql database backup script. | |
# version 2, updated March 26, 2011. | |
# copyright 2011 alvin alexander, http://devdaily.com | |
#---------------------------------------------------- | |
# This work is licensed under a Creative Commons | |
# Attribution-ShareAlike 3.0 Unported License; |
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
export function create() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | |
var r = Math.random() * 16 | 0, | |
v = c === 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
var guid = require('js/guid'); |
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
doctype xml | |
rss(version="2.0", xmlns:atom="http://www.w3.org/2005/Atom") | |
channel | |
title= title | |
link= url | |
description= description | |
language= language | |
atom:link(href="#{ url }feed.xml", rel="self", type="application/rss+xml") | |
each post, slug in public.blog._data | |
if slug !== 'index' |
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
class AtomFeed | |
{ | |
private $xml; | |
function __construct() | |
{ | |
$this->xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" />'); | |
} | |
function setFeedHeader($title, $uri, $updated, $author_name, $author_email, $author_uri) |
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
export const LogLevels = { | |
log : 0, | |
info : 1, | |
warn : 2, | |
error : 3 | |
} | |
function clone(arr) { | |
return arr.map(a => JSON.parse(JSON.stringify(a))) | |
} |
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
root = true | |
[*] | |
indent_style = tab | |
indent_size = 4 |
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
export const keys = Object.freeze({ | |
'o/': '👋', | |
'</3': '💔', | |
'<3': '💗', | |
'8-D': '😁', | |
'8D': '😁', | |
':-D': '😁', | |
'=-3': '😁', | |
'=-D': '😁', | |
'=3': '😁', |