Skip to content

Instantly share code, notes, and snippets.

@cobbspur
cobbspur / changelog-1.6.1.md
Created August 16, 2017 12:37
Changelog 1.6.1
  • cce7aa3b4 Version bump to 1.6.1 - cobbspur
  • c5d641684 Updated Ghost-Admin to 1.6.1 - cobbspur
  • 4d215e217 Version bump to 1.6.1 - cobbspur
  • 8c7d305cd 🐛 Fixed channel context to be based on res.locals (#8910) - Hannah Wolfe
  • 8dafc32bf 🐛 Fix Unsplash when using Night Shift (#828) - Kevin Ansfield
```
- (NSUInteger *)binaryGap(NSInteger N) {
NSMutableString *str = [NSMutableString stringWithFormat:@""];
for (NSInteger NCopy = N; NCopy > 0; NCopy >>= 1) {
[str insertString:((NCopy & 1) ? @"1": @"0") atIndex:0];
}
unichar buffer[str.length];
[str getCharacters:buffer range:NSMakeRange(0, str.length)];
@cobbspur
cobbspur / gh-editor-save-button.hbs
Created July 17, 2015 17:02
publish hack for ghost
<button type="button" {{action "save"}} class="btn btn-sm js-publish-button {{if isDangerous 'btn-red' 'btn-blue'}}">
{{saveText}}
</button>
{{#gh-dropdown-button dropdownName="post-save-menu" classNameBindings=":btn :btn-sm isDangerous:btn-red:btn-blue btnopen:active :dropdown-toggle :up"}}
<i class="options icon-arrow2"></i>
<span class="sr-only">Toggle Settings Menu</span>
{{/gh-dropdown-button}}
{{#gh-dropdown name="post-save-menu" closeOnClick="true" tagName="div" classNames="dropdown editor-options"}}
// setup.hbs
{{#if stepOne}}
<ol>
<li class="active"><span class="step"><i class="icon-check"></i><span class="num">1</span></span></li>
<li><a class="step" {{action "toStepTwo"}}><i class="icon-check"></i><span class="num">2</span></a></li>
<li><span class="step"> <i class="icon-check"></i><span class="num">3</span></span></li>
</ol>
{{/if}
// {{#if stepTwo}}...
@cobbspur
cobbspur / ws install test
Created May 5, 2015 10:20
ws install test
$ npm install ws --verbose
npm info it worked if it ends with ok
npm verb cli [ 'e:\\nodejs\\node.exe',
npm verb cli 'e:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli 'ws',
npm verb cli '--verbose' ]
npm info using npm@1.4.14
npm info using node@v0.10.29
npm verb cache add [ 'ws', null ]
server {
listen 80 default_server;
listen [::]:433 ssl;
listen [::]:80 default_server ipv6only=on;
server_name mydomain.com; # Replace with your domain
root /usr/share/nginx/html;
index index.html index.htm;
@cobbspur
cobbspur / gist:6462778
Created September 6, 2013 11:51
sqlite3
HORUS /e/test/node-sqlite3(remote-binary) $ npm test
> sqlite3@2.1.15 pretest e:\test\node-sqlite3
> node test/support/createdb.js
Creating test database... This may take several minutes.
> sqlite3@2.1.15 test e:\test\node-sqlite3
> mocha -R spec --timeout 200000
> ws@0.4.30 install C:\Users\David\AppData\Roaming\npm\node_modules\jitsu\node_m
odules\nodejitsu-api\node_modules\preacher-api\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\Users\David\AppData\Roaming\npm\node_modules\jitsu\node_modules\nodejitsu-api
\node_modules\preacher-api\node_modules\ws>node "e:\nodejs\node_modules\npm\bin\
node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.