Skip to content

Instantly share code, notes, and snippets.

@hdeshev
hdeshev / delete-all-messages.js
Last active May 2, 2020 07:07 — forked from rcx/delete-all-messages.js
Delete all your messages in a Discord channel
clearMessages = function (guild_id, authToken, deleted = new Set(), interval = 1000) {
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
const searchURL = `https://discordapp.com/api/v6/guilds/${guild_id}/messages/search?include_nsfw=true`
const headers = { Authorization: authToken }
let clock = 0
function delay(duration) {
return new Promise((resolve, reject) => {
#!/bin/sh
set -e
NS_DIR=$(pwd)
APP_DIR=$1
grunt default --test-app-only=true --runtslint=false
rsync -XPav bin/dist/apps/tests/ $1/app/
import {Directive, ElementRef, Input} from "angular2/core";
import {View} from "ui/core/view";
@Directive({
selector: '[dump]'
})
export class DumpDirective {
@Input('dump') name: any;
constructor(private element: ElementRef) {
import * as hookMod from 'angular2/src/router/lifecycle_annotations';
import * as routerMod from 'angular2/src/router/router';
import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {Promise, PromiseWrapper} from 'angular2/src/facade/async';
import {BaseException} from 'angular2/src/facade/exceptions';
import {
ElementRef, DynamicComponentLoader, Directive, Injector, provide, ComponentRef, Attribute
} from 'angular2/core';
import {
dist
cabal-dev
*.o
*.hi
*.chi
*.chs.h
.virtualenv
.hpc
.hsenv
.cabal-sandbox/
ninja_required_version = 1.6
tsflags = --module commonjs --noEmitOnError --noImplicitAny --emitDecoratorMetadata --experimentalDecorators --target es5
rule tsc
command = ./node_modules/.bin/tsc $tsflags "$in" && node build/getrefs.js "$in" "$out" "$in.dep"
description = TypeScript compile: $in
depfile = "$in.dep"
deps = gcc
rule dts
command = touch "$out"
description = TypeScript declarations: $in
@hdeshev
hdeshev / .ctags-css
Last active May 4, 2017 17:01
ctags extras
--langdef=css
--langmap=css:.css
--langmap=css:+.scss
--langmap=css:+.sass
--langmap=css:+.styl
--langmap=css:+.less
--regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/

For maximum Python 2.x -> Python 3 compatibility:

from future import absolute_import, division, print_function, unicode_literals

@hdeshev
hdeshev / set_attributes.py
Created August 24, 2012 12:12 — forked from skanev/set_attributes.py
Set arguments passed to the constructor as attributes
import inspect
from functools import wraps
def set_attributes(constructor):
@wraps(constructor)
def wrapped(self, *args, **kwargs):
names = inspect.getargspec(constructor).args
for (key, value) in dict(zip(names[1:], args)).items():
setattr(self, key, value)
for (key, value) in kwargs.items():
@hdeshev
hdeshev / PowerShell-remoting.md
Created March 16, 2012 18:42
Enable PowerShell remoting

Setting up PowerShell remoting.

First, you need to install PowerShell version 2.

Enabling remoting on the server machine

Log in to the server machine, start PowerShell as an administrator and execute:

Enable-PSRemoting