Skip to content

Instantly share code, notes, and snippets.

View nicksergeant's full-sized avatar

Nick Sergeant nicksergeant

View GitHub Profile
@nicksergeant
nicksergeant / mastodon_reblogs.exs
Created November 5, 2022 13:58
Show Mastodon accounts you're hiding reblogs for, and optionally re-show reblogs for all accounts.
domain = "mastodon.social"
your_account_id = "12345"
bearer_token = "Find this in Chrome Developer Tools -> Network -> an API request -> Headers -> Request Headers -> Authorization"
headers = [
Accept: "application/json",
"content-type": "application/json",
Authorization: "Bearer #{bearer_token}"
]
@nicksergeant
nicksergeant / cvimrc
Last active March 13, 2018 20:28
cvimrc
map <C-d> scrollPageDown
map <C-u> scrollPageUp
map J nextTab
map K previousTab
map <C-p> nextScrollPosition
'atom-text-editor.vim-mode-plus:not(.insert-mode)':
', a': 'narrow:search'
', c ,': 'clear-all-modes'
', c space': 'editor:toggle-line-comments'
', e': 'git-blame:toggle'
', g': 'open-on-github:file'
', shift-a': 'narrow:search-by-current-word'
':': 'go-to-line:toggle'
';': 'prettier:format'
'H': 'vim-mode-plus:move-to-first-character-of-line'
### Keybase proof
I hereby claim:
* I am nicksergeant on github.
* I am nicksergeant (https://keybase.io/nicksergeant) on keybase.
* I have a public key whose fingerprint is 8769 598E A09B 085E 6AAE ADEA 3622 EFED AE18 14B8
To claim this, I am signing this object:
@nicksergeant
nicksergeant / routes.js
Created January 29, 2014 02:52
Angular services with $http.
// Controller.
function SearchView($scope, SavedSearches) {
// Get all of the user's saved searches.
SavedSearches.all().then(function(response) {
$scope.savedSearches = response.data;
});
// Create a new saved search.
$scope.create = function() {
// Simple.com is awesome. If you're waiting for goals, you can try using this with
// the dotjs plugin for Chrome or Firefox:
$(function() {
var NickSimple = function(NickSimple) {
var that = this;
this.init = function() {
that.$stsHeader = $('header#safe-to-spend');
/* Background: we're testing a UI that updates asynchronously at unknown intervals. */
// Let's start our test:
describe('watch UI for updates', function(){
it('should test the UI periodically', function() {
browser().navigateTo('http://localhost/mytestpage');
expect(element('div.result').text()).toBe('running'); // Passes.
// Meanwhile, the UI is auto-updating div.result at unknown intervals, so using sleep
<!DOCTYPE html>
<html lang="en" ng-app="App">
<head>
<title>AngularJS Example.</title>
<meta charset="utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script>
<script type="text/javascript">
~ weechat-curses
irc: connecting to server ssl.domain.com/6666 (SSL)...
irc: TLS handshake failed
irc: error: The TLS connection was non-properly terminated.
irc: reconnecting to server in 10 seconds
... now I try /reconnect
irc: connecting to server ssl.domain.com/6666 (SSL)...

[[tweet-319285740448133123]]